Re: Increase a month
| From: | Sebastian | Date: | Fri, 21 Mar 2003 21:19:14 +0000 |
| Subject: | Re: Increase a month | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140636@lists.php.net to get a copy of this message | ||
i think strtotime() doesn't understand the $month variable, Since you are
adding $month + 1 the function strtotime needs the + and the variable is not
passing the + sign .. hope that makes sense .. instead of putting a variable
in strtotime try just doing strtotime("+1 month"); and see if it works.
Note: strtotime() does the math, thats why it doesn't work, or at least
thats what i think is happening.
cheers,
- Sebastian
-----Original Message-----
From: shaun [mailto:shaun@mania.plus.com]
Sent: Thursday, March 20, 2003 4:00 PM
To: php-general@lists.php.net
Subject: [PHP] Increase a month
Hi,
could someone tell me why this:
<?php
$month = date(m);
echo "\$month: ".date(F,strtotime($month))."<br>";
$month = $month + 1;
echo "\$month: ".date(F,strtotime($month))."<br>";
?>
outputs this:
$month: March
$month: March
surely it should be:
$month: March
$month: April
Thanks in advance for your help.