note 20092 added to function.next

From: Date: Fri, 22 Mar 2002 04:47:41 +0000
Subject: note 20092 added to function.next
Groups: php.notes 
Request: Send a blank email to php-notes+get-28061@lists.php.net to get a copy of this message
I suppose you could use a for loop if you're more comfortable with them: $foo = range(0,20); for($i = reset($foo); !is_bool($i); $i = next($foo)){ echo "$i\n"; } Note: If it's possible that zero exists in your array, then you should use the is_bool() check for the conditional statement. I noticed that the for loop will break on (actual) values of zero. -- http://www.php.net/manual/en/function.next.php http://master.php.net/manage/user-notes.php?action=edit+20092 http://master.php.net/manage/user-notes.php?action=delete+20092 http://master.php.net/manage/user-notes.php?action=reject+20092

« previous php.notes (#28061) next »