-
Pet Projects
Tag Archives: tutorials
Zend DevZone has a new article up. What is a View Helper? A View Helper is simply a class that follows particular naming conventions, When attached to a view object, you can call the helper as if it were a … Continue reading
This is useful to those who are trying to kick start a Zend Framework application. Starting any new application is like walking into a shop and being dazzled by the displays. You want everything but finally realise you only have … Continue reading
A short but complete tutorial on how to write a Chat Application using PHP, AJAX and XML. Developers talk a lot about community when the term Web 2.0 comes up. And whether you think it’s hype or not, the idea … Continue reading
Here is how to get the difference between two dates in PHP. … public static function toTimestamp($date){ $arrayDate=self::toArray($date); return mktime($arrayDate[’hour’],$arrayDate[’minute’],$arrayDate[’second’],$arrayDate[’month’],$arrayDate[’day’],$arrayDate[’year’]); } public static function dateDiff($date1,$date2,$unit=’HOUR’){ $date1=self::toTimestamp($date1); $date2=self::toTimestamp($date2); $secs=$date1-$date2; switch(strtoupper($unit)){ case ‘WEEK’:return $secs/60/60/24/7; break; case ‘DAY’:return $secs/60/60/24; break; … Continue reading