Question about the php two-dimensional array: I have a page. searchFangxiang. php defines a two-dimensional array: & lt ;? $ Fangxiangarray (fid101 & gt; array (fid & gt; 101, Name & gt; Emy of automation, Prof. Zhang), & nbsp; & nbsp; & question about the php two-dimensional array.
I now have a page named searchFangxiang. php that defines a two-dimensional array:
Array ("fid" => "101", "Name" => "Institute of Automation", "professor Zhang" => "),
'Fid102 '=> array ("fid" => "102", "Name" => "laboratory", "professor Li "),
'Fid103 '=> array ("fid" => "103", "Name" => "Institute of Science", "professor Wang ")););
?>
Then I reference the two-dimensional array page on my application page.
Echo "";
?>
Now the application page has an id. how can I traverse this two-dimensional array, find the group with the same fid and page id in the two-dimensional array, and then output the information of this group in the tag?
------ Solution ----------------------
Based on your data organization, no traversal is required
Just echo $ fangxiang ["fid $ id"] ['name '];
------ Solution ----------------------
Searched.
$ Fangxiang = array (
'Fid101 '=> array ("fid" => "101", "Name" => "Institute of Automation", "professor Zhang "),
'Fid102 '=> array ("fid" => "102", "Name" => "laboratory", "professor Li "),
'Fid103 '=> array ("fid" => "103", "Name" => "Institute of Science", "professor Wang" => "),
);
?>