Page 1 of 1

php date

Posted: Mon May 04, 2009 4:02 am
by matthew0786
Ok, i have a variable defined for example

Code: Select all

$month = January
How do i change the value (for example add 1 month to $month to become February). Is there such a function to add months ??

Re: php date

Posted: Mon May 04, 2009 4:04 am
by susrisha

Re: php date

Posted: Mon May 04, 2009 1:51 pm
by McInfo

Code: Select all

<?php
$month = 'February';
echo date('F', strtotime($month.' +1 month')); // March
?>
Edit: This post was recovered from search engine cache.