problem while loop.

From: Date: Sun, 24 Feb 2002 15:59:13 +0000
Subject: problem while loop.
Groups: php.general 
Request: Send a blank email to php-general+get-85996@lists.php.net to get a copy of this message
I have a problem while loop that isn't terminating when it's supposed to. I can't figure out what the problem is, if I run a comparison inside the while loop it matches as it should, but for some reason the same comparison isn't working as the while loop expression. I get an infinite loop when I run this code. while(strtotime($event_date) <= strtotime($end_date)){ # test to see if the loop should of stopped. if(strtotime($event_date) <= strtotime($end_date)) echo "GO!!\n"; else echo "STOP!!!!!!!!!!!!!!!\n"; /* omitted code that finds the next $event_date */ } -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper

« previous php.general (#85996) next »