note 28637 added to control-structures.switch
| From: | theonly dot mcseven at gmx dot net | Date: | Sun, 19 Jan 2003 02:44:18 +0000 |
| Subject: | note 28637 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42372@lists.php.net to get a copy of this message | ||
working a bit around with it I found out that it is not possible to
compare the variable with two different values in one step like this
(system running a w2k server, apache2.0.43 & php430):
switch ($myvar) {
case ("foo" || "bar"): //do something
break;
case ("other"): //do another thing
break;
default:
}
rather use:
switch ($myvar) {
case ("foo"):
case ("bar"): //do something
break;
case ("other"): //do another thing
break;
default:
}
--
http://www.php.net/manual/en/control-structures.switch.php
http://master.php.net/manage/user-notes.php?action=edit+28637
http://master.php.net/manage/user-notes.php?action=delete+28637
http://master.php.net/manage/user-notes.php?action=reject+28637