View Full Version : About Switch Statement.
Nasimov
03-23-2004, 08:07 PM
It's possible to have multiple values in one case?
case "1,2,3"
Thanks.
PhilG
03-24-2004, 12:15 AM
Yep you sure can but you will need the following format:
<?php
switch ($i) {
case 0:
case 1:
case 2:
echo "i is less than 3";
break;
case 3:
echo "i is 3";
}
?>
Hope that helps :-)
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.