Working with JSON in PHP and jQuery
I mentioned in a previous post that I was writing a book on PHP and jQuery. Well, after a labor of around 7 months the book is out now. It is available on Packt website as well as Amazon. Meanwhile, to...
View ArticleWorking with XML Documents in PHP and jQuery
Here is one more sample chapter from my book. It explains reading, writing and editing XML files with PHP and jQuery. Below are the chapter contents. Loading XML from files and strings using SimpleXML...
View ArticlePHP: Defining configuration values
Every web application requires configuration files which contain values that are used throughout the application. In this post we will look at some of the methods developers use to define configuration...
View ArticlePHP: Expanding URLs using Google URL shortener API
Yesterday. google launched an API for its URL shortening service http://goo.gl. Using this API developers will be able to expand/shorten URLs and get a user’s analytics and history programmaticaly....
View ArticleUsing PHP and cURL to expand URLs using Google URL shortener API
Yesterday I wrote this post explaining how short goo.gl URLs can be expanded using the newly launched goo.gl API. In that code we used php function get_file_contents to get the response from API. How...
View ArticlePHP: Shorten URLs using Google URL shortener API
In past 2 posts you saw how short URLs can be expanded using the Google URL shortener API. This post shows how URLs can be shortened using this API. API key is not mandatory for test purpose. Use this...
View ArticleWordPress Internal Server Error 500 in wp-admin
If you are getting an internal server error 500 after installing wordpress while accessing admin, here is the fix. Most likely it is caused by low memory limit on your server. To fix it, create a new...
View ArticlePHP class for expanding and shortening URLs using Google URL shortener API
I have combined the 2 previous posts for expanding and shortening goo.gl URLs and have created a small class for it. Below is the download link for the class. Expanding a URL <?php...
View ArticlePHP: Get intersecting dates between 2 date ranges
Here is a small code snippet that will give you intersecting dates between 2 date ranges. Say, for example, you have 2 date ranges, 1-Jan-2011 to 31-Mar-2011 and 23-Feb-2011 to 4-May-2011. This...
View ArticleCode snippet : WordPress qTranslate – Getting current language
So I was working with the qTranslate plugin of WordPress’s and needed to select an image depending on language. qTranslate provides a utility function which returns the current language. The function...
View Article