Monthly Archives: April 2011

Get facebook Like button statistics with PHP

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

Posted in PHP | Tagged | 2 Comments

Enable Curl in XAMPP

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

Posted in PHP | Tagged , | Leave a comment

youtube embed code with PHP

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

Posted in PHP | Tagged | 1 Comment

Cut A String by a number of words PHP

Cut_string_by_words function cuts a string by a number of words specified in $num_of_words argument. Sample Code:

Posted in PHP | Tagged , | Leave a comment

PHP remove extra space in a string

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.

Posted in PHP | Tagged | Leave a comment

php spam check function isSpam

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

Posted in PHP | Tagged , | Leave a comment

Change SugarCRM Logging Level

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

Posted in PHP | Tagged | Leave a comment

sugarCRM developer mode on

One of the things that I like when I first worked with sugarCRM is developer mode. When it is turned on, sugarCRM will ignore the cache files and new changes will be compiled by sugar and displayed instantaneously. Continue reading

Posted in PHP | Tagged | 2 Comments