Simple PHP Text Limiter Function
This function will limited a text string to a given word limit.<?phpfunction string_limiter($string, $limit = 50, $end_char = '…'){ if (trim($string) == '') {...
View ArticlePHP Header() Function - Force header for a file to download in PHP
This either in PHP will help you to sends the files: <?php$file = 'folder/yourfile.zip' ; //Any file *.*if (! file) { die('file not found'); //Or do something } else { // Set headers...
View ArticlePHP reverse function strrev() and it's alternative
If you ever wondered how to reversing a string using PHP reverse function “strrev()” and write your own function doing the same thing? Oddly I was asked to write my own PHP function to reverse a string...
View ArticleSimple PHP function to generate a random string based on Alpha, Numeric,...
Here's a simple function to generate a random string based on Alpha, Numeric, Nozero, MD5 and SHA1 types.read more
View ArticleHow to install YUM, Zend Optimizer, eAccelerator and APC
Recently a friend had difficulty installing Alternative PHP Cache (APC) and upload progress for his Drupal CMS on Debian VPS. Therefore I tought of sharing this post about how to setup and run your...
View ArticleMicrosoft Word Document HTML Cleanup in PHP
I had to cleanup a HTML created out of MS Word Document manually. Honestly it is a pain to manually search and replace all the junks Word Document generating. So I have written a text conversion...
View ArticleConvert Linux/Unix timestamp to human readable format in PHP
This functin will help to convert the Linux/Unix timestamp to human readable format:function unix_timestamp_to_human ($timestamp = "", $format = 'D d M Y - H:i:s'){ if(empty($timestamp)||!...
View ArticleRemove www and rewrite URL for multi-sites or subdomains in .htaccess
If you are running a Multisites or Subdomains sites this .htaccess RewriteRule code might come in handy specially for purpose of SEO. You can clean up your URL from http://www.yourdomain.com to...
View ArticleURL rewriting and add www to .htaccess for hosting multiple domain or multi...
Adding the www to URL in .htaccess for hosting multiple domain or multisites and handle www issue for canonical URLs. ##Adding the www RewriteCond %{HTTP_HOST}!^www\. [NC] RewriteCond...
View Article40 Most Needed Drupal Modules
Here are my top 40 Drupal modules that seem to happen more often I am using them in my Drupal projects. 1. addtoany 2. blocks404 3. boost 4. cacherouter 5. canonical_url 6. captcha 7. cck 8....
View ArticleUsing th native MySQL ENUM type in Symfony 1.4 and Doctrine
To use the native MySQL ENUM type in Symfony and Doctrine you will have to update your "project/config/databases.yml" and add the "use_native_enum" directive under "attributes" i.e: attributes:...
View ArticleSymfony and sfDoctrineGuard missing installation point
If you are getting the 500 error (Call to undefined method myUser::isAnonymous.) after installing the sfGuardDoctrine plugin i.e Add these lines in your apps/app name/config/factories.yml to make to...
View ArticlePHP custom debugging functions
Here is another debugging helper for Symfony, CodeIgniter, Kohana and Zend frameworks or your applications. Normally you would use var_dump() or print _r() for debugging but dumping the data without...
View ArticleInstalling Nodejs, NPM and Google V8 on UBUNTU
A) Install the essential compilers, packages and Google V8 sudoapt-get updatesudoapt-getinstall build-essential curl openssl libv8-2.0.3 B) Download and install the Nodejs from source wget...
View ArticleSymfony2 and SQLite3 or PDO_SQLite extension error
If you are getting You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly To resolved it install the php5-sqlite sudoapt-getinstall php5-sqlite#restart the...
View Article
More Pages to Explore .....