Monthly Archives: April 2011
Facebook API allows us to retrieve the statistics for “Like” button given a “liked” URL. The function get_facebook_like_button statistics returns xml result from facebook for a “liked” URL. This function utilizes CURL in PHP to retrieve the data from facebook. … Continue reading
To enable Curl in XAMPP, you need to do the following: 1. uncomment the following line in php.ini files: ;extension=php_curl.dll 2. php.ini files can be found in the following locations (depends on which directory you installed XAMPP on your computer. … Continue reading
The get_youtube_embed function below generates embed code for a youtube video given its id. You also have the option to set whether the video should be played automatically or not once the web page is loaded. Sample Code: Get the … Continue reading
Cut_string_by_words function cuts a string by a number of words specified in $num_of_words argument. Sample Code:
The function remove_extra_space removes extra spaces in a string. If you want to completely remove all space(s) in a string then change then use the function below.
Nobody likes spam and web sites with ton of spams can be annoying to the end users and frustrating to the web master or developer. Using regular expression and php function preg_match, we can check for spam as shown in function isSpam below. Continue reading
SugarCRM allows you to enable different logging levels. By default, logging level is set to “Fatal” and the default log file’s name is sugarcrm.log. Continue reading