Today's Question:  What are you most afraid of as a programmer?        GIVE A SHOUT



  Date interval add and sub prior to PHP 5.3

After PHP 5.3, we can use DateInterval object or date_interval_create_from_date_string() function to add or subtract days,weeks,months or years to or from a DateObject.But prior to PHP 5.3,we cannot do this. If we want to achieve the same effect. We need to use some skills. Here is one:We can use strtotime() function to achieve this. For example:$date=date('Y-m-d',time());$datestamp=strtotime(date('Y-m-d',strtotime($date)).' +1 day'); $datestamp=strtotime(date('Y-m-d',strtotime($date)).' +1...

9,578 0 0          PHP CLASS DATEINTERVAL PHP 5.3 PHP 5.2