I couldn't find a definitive answer on php.net so I'm hoping you can answer.
Can the case of a switch statement detect an array key rather than the value?
I tried a little experiment, see below, to see if I could get this to work but all I get is the default value returning.
$inString = "$_POST[latitudefield1]";
switch($_POST){
case $_POST['latitudefield1']:
echo"1";
break;
case "latitudefield1":
echo"2";
break;
case "".$_POST['latitudefield1']."":
echo"3";
break;
case $inString:
echo"4";
break;
default:
echo"5";
}
Am I attempting the impossible, or have I just got the wrong format for the case?