Code: Select all
if ($f == 43 | 2 | 56 | 38) {
//Do stuff
} else {
if ($f == 34 | 53 | 4 | 9) {
//do other stuff
} else {
if ($f == 3 | 10 | {
//do more crap
} else {
//other things
}
}
}
}Moderator: General Moderators
Code: Select all
if ($f == 43 | 2 | 56 | 38) {
//Do stuff
} else {
if ($f == 34 | 53 | 4 | 9) {
//do other stuff
} else {
if ($f == 3 | 10 | {
//do more crap
} else {
//other things
}
}
}
}Code: Select all
switch($f){
case 43:
case 2:
case 56:
case 38:
echo 'its either 43,2,56, or 38';
break;
case 34:
case 53:
case 4:
case 9:
echo 'its either 34,53,4, or 9';
break;
case 3:
case 10:
case 8:
echo 'its either 3,10 or 8';
break;
default:
echo 'none of those.';
}Code: Select all
$nums = array("43","2","56","38");
$nums2 = array("34","53","4","9");
if(in_array($f,$nums)) {
//Do stuff
} elseif(in_array($f,$nums2)) {
//Do stuff
} else {
//Do stuff
}