note 60080 added to control-structures.continue

From: Date: Sun, 25 Dec 2005 17:01:11 +0000
Subject: note 60080 added to control-structures.continue
Groups: php.notes 
Request: Send a blank email to php-notes+get-100683@lists.php.net to get a copy of this message
Hello firends It is said in manually: continue also accepts an optional numeric argument which tells it how many levels of enclosing loops it should . In order to understand better this,An example for that: <?php /*continue also accepts an optional numeric argument which tells it how many levels of enclosing loops it should skip.*/ for($k=0;$k<2;$k++) {//First loop for($j=0;$j<2;$j++) {//Second loop for($i=0;$i<4;$i++) {//Third loop if($i>2) continue 2;// If $i >2 ,Then it skips to the Second loop(level 2),And starts the next step, echo "$i\n"; } } } ?> Merry's christmas :) With regards,Hossein ---- Manual Page -- http://www.php.net/manual/en/control-structures.continue.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60080 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60080&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60080&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#100683) next »