note 26318 added to control-structures.break

From: Date: Sat, 26 Oct 2002 08:26:36 +0000
Subject: note 26318 added to control-structures.break
Groups: php.notes 
Request: Send a blank email to php-notes+get-38578@lists.php.net to get a copy of this message
Strange...cant get this to work... if(@$somevar){ foreach ($a as $b){ if($b=="foo"){ do something; break 2; } if($b=="bar"){ do something else; }else{ foobar(); } } $foo=$bar; } Dont mind the vars, they mean nothing and for example...In my real code, "break 2" gives back an error (Fatal error: Cannot break/continue 2 levels), but if I use only "break" or "break 1", then the $foo=$bar line gets done, and I dont want that! What am I doing wrong? -- http://www.php.net/manual/en/control-structures.break.php http://master.php.net/manage/user-notes.php?action=edit+26318 http://master.php.net/manage/user-notes.php?action=delete+26318 http://master.php.net/manage/user-notes.php?action=reject+26318

« previous php.notes (#38578) next »