Thank you for the replies.
bradgrafelman - yes I was trying to see if a given index exists in the $POST array. The reason being I have four latitude and longitude pairs the user inputs on my page (to create a working area). I was hoping to use a switch to go through the $POST array, rather than have a series of else if's as I thought the code would be neater/ easier to read.
laserlight - I may have misinterpreted your reply but when you said it certainly can, did you mean I can get a case statement to evaluate the array key and not value?
I tried another experiment to see what would work, but as you can see this only picks up the values.
$arr = array(0=>'a',1=>'b',2=>'c',3=>'d');
for($x=0;$x < sizeof($arr);$x++){
echo("x=".$x." ");
echo("value=".$arr[$x]." ");
switch($arr[$x]){
case 'a':
echo" case a <br/>";
break;
case 'b':
echo" case b <br/>";
break;
case 2:
echo" case 2 <br/>";
break;
case 'd':
echo" case d <br/>";
break;
default:
echo" None of the above <br/>";
break;
}
}
/* OUTPUTS
x=0 value=a case a
x=1 value=b case b
x=2 value=c None of the above
x=3 value=d case d
*/
I really appreciate all your help - Emma