note 40411 added to control-structures.while

From: Date: Wed, 03 Mar 2004 10:11:10 +0000
Subject: note 40411 added to control-structures.while
Groups: php.notes 
Request: Send a blank email to php-notes+get-66153@lists.php.net to get a copy of this message
virtualjosh at yahoo dot com (Hosh): Hosh wrote >> $array = $save; test_time("",1); reset($array); while ($next = next($array)) { $key = key($array); $array[$key] = $array[$key] * 100; } test_time("while (\$next = next(\$array))"); The code above leave out the first element of the array. The code below will step trough the whole array in the same way. $pos = reset($array); while ($pos) { $key = key($array); $array[$key] = $array[$key] * 100; $pos = next($array); } Regards, Örjan ---- Manual Page -- http://www.php.net/manual/en/control-structures.while.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40411 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40411&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40411&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66153) next »