php switch
Posted: Thu Mar 26, 2009 3:16 pm
Hi all,
I am having a problem constructing a php swtich statement that looks like this
But something is wrong with the above as it keeps defaulting to the first case statement all the time no matter the value of hosturl. The only way i can make it work as desired is if i converted it to an if else statement. Is there a way to make it work for the switch?
I am having a problem constructing a php swtich statement that looks like this
Code: Select all
switch ($HostURL) { // Find which site to redirect to
Case ("a") || ("b"):
echo "1";
break;
Case ("c") || ("d"):
echo "2";
break;
default: // Default to main page
echo "3";
}