這是我的數組;在數組中搜索
$subcategory = array(
"cata" => array("", "Finance", "Economics", "Accounting", "Operations Management"),
"catb" => array("", "Computer Science", "Electrical Engineering", "Mechanical Engineering", "Civil Engineering"),
"catc" => array("", "Poetry", "Literature", "Communications"),
"catd" => array("", "American History", "European History", "World History")
);
如果我搜索「詩」,我怎麼能得到回報「CATC」?
這裏有一個提示:'for'環路'for'循環 –
內通過循環陣列上,然後遍歷每個嵌套陣列。這是PHP語法的一個簡單問題,向我們展示您嘗試的內容,我們可以幫助您解決任何問題。 – meagar