0
foreach loop in multidimensional array
hey all, I have an array $details = array( array( "roll_no" => "1", "name" => "Xyz"), array( "roll_no" => "2", "name" => "iyz"), array( "roll_no" => "3", "name" => "Xaz")); I would like to print name using the roll no. Eg: Localhost/test.php?roll_no=3 I would like to echo Xaz. Thanks for the help.
1 ответ
0
try this - echo $details[$_GET['roll_no']-1]['name']