-
Recent Posts
Tags
Recent Comments
Archives
Categories
Meta
Category Archives: PHP
Read CSV file with PHP
Reading the content of a CSV file can be done with PHP easily; thanks to PHP built-in function fgetcsv. Below is the sample code to read CSV file (comma separated). The content of the CSV file is shown below. Below … Continue reading
Posted in PHP
Leave a comment
sugarCRM view sugarBean of a module
It was hard for me to work with a sugarCRM module at first without seeing a its sugarBean structure and what kind of data or information being populated in a sugarBean. So, I found a way to access any sugarBean object of a module as described below.
sugarCRM view PHP error/warning/notice
One quick way to view PHP error, warning or notice in sugarCRM system is to turn on error_reporting in php.
You can do this within sugarCRM if you have limited access php.ini file.
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
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
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
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:
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.
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
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