note 85661 added to control-structures.switch
| From: | mitchell/ | Date: | Thu, 11 Sep 2008 00:52:29 +0000 |
| Subject: | note 85661 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144328@lists.php.net to get a copy of this message | ||
double switch
<?php
$foo = 2;
$bar = 11;
switch ($foo) {
case 1:
echo 'foo is 1//';
break;
case 2:
echo 'foo is 2//';
switch ($bar) {
case 10:
echo 'bar is 10//';
break;
case 11:
echo 'bar is 11//';
break;
default:
echo 'bar is neither 10 or 11//';
break;
}
break;
default:
echo 'foo is neither 1 or 2//';
break;
}
?>
output:
foo is 2//bar is 11//
----
Server IP: 117.104.160.194
Probable Submitter: 203.173.40.150
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/85661
Del: integrated -- https://master.php.net/note/delete/85661/integrated
Del: useless -- https://master.php.net/note/delete/85661/useless
Del: bad code -- https://master.php.net/note/delete/85661/bad+code
Del: spam -- https://master.php.net/note/delete/85661/spam
Del: non-english -- https://master.php.net/note/delete/85661/non-english
Del: in docs -- https://master.php.net/note/delete/85661/in+docs
Del: other reasons-- https://master.php.net/note/delete/85661
Reject -- https://master.php.net/note/reject/85661
Search -- https://master.php.net/manage/user-notes.php