note 61935 added to control-structures.foreach

From: Date: Wed, 15 Feb 2006 14:39:16 +0000
Subject: note 61935 added to control-structures.foreach
Groups: php.notes 
Request: Send a blank email to php-notes+get-103772@lists.php.net to get a copy of this message
To comment on the foreach statement behaviour comment below: The reason for this different behaviour is that the foreach statement is equivalent to the each statement. They both make use of an internal pointer. To loop through the complete array after a change you could use the reset statement on the array. ---- Server IP: 83.137.20.120 Probable Submitter: 80.60.63.114 ---- Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61935 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61935&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61935&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103772) next »