Magic of PEAR – Date TimeZone

PEAR is a framework and distribution system for reusable PHP components. How we get PEAR packages with php files? Add block of code to the php file…. <?php // include PEAR class include (“Date.php”); // initialize Date object $d = new Date(“1981-08-07 01:30:11”); // retrieve date to display echo $d->getDate(); // retrieve date as formatted … Read more

Install the Alternative PHP Cache (APC)

The Alternative PHP Cache (APC) is a free, open, and robust framework for caching and optimizing PHP intermediate code. yum install php-pear yum install php-devel httpd-devel yum groupinstall ‘Development Tools’ yum groupinstall ‘Development Libraries’ pecl install apc http://si2.php.net/manual/en/install.pecl.php

Install JSON on linux

Have the fun with json…. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. # yum -y install php-pear # pecl install json # vi /etc/php.d/json.ini extension=json.so # service httpd restart

Trim and remove empty key & value in php array

Here is the PHP function that will remove empty key => value in PHP array… function array_trim($sv) { $s = 0; $svn = null; $c = count($sv); for($i = 0; $i < $c; $i++) { if($sv[$i] != “”){ $svn[$s++] = trim($sv[$i]); } } return $svn; } $svarray = array(‘   ‘, ‘svlinux’, ‘svnlabs’, ‘lamp’, ”); $svarray … Read more

CakePHP in svnlabs

CakePHP is the rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It follows design patterns like MVC and ORM, CakePHP reduces development costs and helps developers write less code. Features of CakePHP: – Extremely Simple. – Active, Friendly Community. – Flexible License. – Clean IP – Best … Read more