Below is a multi level array, 0,1,2 is basically a unique id for each question, and below basically validates a correct input, but i cant get it to work!!!!
$array=array("0" => array("0" => "Question 1",
"1" => array("0" => "Win 1",
"1" => "Win 2",
"2" => "Win 3",
"3" => "Win 4"),
"2" => array("0" => "Loose 1",
"1" => "Loose 2",
"2" => "Loose 3",
"3" => "Loose 4")),
"1" => array("0" => "Question 2",
"1" => array("0" => "Win 1",
"1" => "Win 2",
"2" => "Win 3",
"3" => "Win 4"),
"2" => array("0" => "Loose 1",
"1" => "Loose 2",
"2" => "Loose 3",
"3" => "Loose 4")),
"2" => array("0" => "Question 3",
"1" => array("0" => "Win 1",
"1" => "Win 2",
"2" => "Win 3",
"3" => "Win 4"),
"2" => array("0" => "Loose 1",
"1" => "Loose 2",
"2" => "Loose 3",
"3" => "Loose 4")));
if(!in_array_multi($_POST['RadioButton'],$crimeresults)){
echo"Invalid Qestion";
}else{
echo"Valid Question";
}
$_POST['RadioButton'] is either 0,1 or 2.
For some reason, it always displays "Invalid Question", I cant seem to get my head round it, maybe its because ive been staring at it for too long :| any help would be greatly appreciated!!
Thanks, Dan