-
Pet Projects
Monthly Archives: January 2008
Given 2008-01-31 as the current date and the value of “$days_before” is 2, the code will echo 2008-01-29. The date 2 days before the current date. $days_before = 2; $current_date = date(’Y-m-d’); $str = strtotime($current_date)-(86400*$days_before); //1 day has 86400 echo … Continue reading
Here is how you get the number of days between two dates. function getdays($day1,$day2) { return round((strtotime($day2)-strtotime($day1))/(24*60*60),0); } $begin = date("Y-m-d"); // we set today as an example $end = "2007-01-29"; echo getdays($begin,$end).’ days’; This was taken from … Continue reading
Before anything else, I want the readers to know that I have used Zend Framework for a few months prior to using Code Igniter. I hang out in #zftalk (freenode) when I have time. So I am more of a … Continue reading
I have written this simple user authentication and user access privilege plugin in one of my Web Apps. First, in my AuthController, I have something like this: public function loginAction() { try { if ($this->_request->isPost()) { // collect the data … Continue reading