.... gives the following output:
$i : Month: Year 0 : 08 : 2004 1 : 10 : 2004 2 : 10 : 2004 3 : 12 : 2004 4 : 12 : 2004 5 : 01 : 2005 6 : 03 : 2005 7 : 03 : 2005 8 : 05 : 2005 9 : 05 : 2005 10 : 07 : 2005 11 : 07 : 2005
Your bug is being caused by short months. If you ask mktime() to give you the 31st day of november, it will assume you mean the 1st of december. You can see more clearly what's going on if you shorten your code, like so:
for($i=0;$i < 12;$i++) { echo "{$i}: "; echo date("d m Y",mktime(0, 0, 0,date("m")+$i , date("d"), date("Y"))); echo '<br>'; }
It's a good thing you're trying this today; if you had tried it a few days ago, you wouldn't have had any idea that your method wasn't working.
------------------------------------------------------ michal migurski- contact info and pgp key: sf/ca http://mike.teczno.com/contact.html
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php