switch ($x) { case $a: case $b: case $c: case $d: //do whatever you need break; default: //catch any other values here break; }
Neil
BOOT wrote:
*********************************************** This Email Has Been Virus Swept ***********************************************
Hello!
Can anyone tell me if there is an easier/shorthand for:
if ( ($x == $a) || ($x == $b) || ($x == $c) || ($x == $d) ....... ) {;}
I understand the logic of why the following does not work:
if ($x == ($a || $b || $c || $d)) {;}
Thanks!
-- ---------------------- www.curvedvision.com ----------------------
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.
*** This Email Has Been Virus Checked ***
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php