I was working out the best way to loop through a series of dates and tried this code. It gets stuck at Oct. 26, 2003 everytime. Can someone run this on their server and see if it does the same thing. I can find other ways to do this but I was confused why this wont work. Here’s the code.
[php]
<?php $cur_date = '20030901'; $drop_date = '20040501'; $i = 0; while ($cur_date <= $drop_date) { echo $cur_date."rn"; echo strtotime($cur_date) + 86400; echo "rn"; $cur_date = date('Ymd', strtotime($cur_date) + 86400); ++$i; if ($i > 300) { exit('Caught loop'); } } ?>[/php]
I am running this on a Linux server, slackware with 2.2.19 kernel, Apache 1.3.29 and PHP 4.3.6. Any input would be great. Like I said, I have a work around but it just caught me as odd. I was trying several ways to do this to see which was fastest and this one didn’t work.
Keith