我有一個數組這樣的:如何在multidimensionnal陣列(PHP)獲取鍵的值
array(2) {
["dashboard"]=>
array(3) {
["controller"]=>
string(5) "Index"
["action"]=>
string(5) "index"
["path"]=>
string(34) "dashboard/user/example/{page}/{id}"
}
["home"]=>
array(3) {
["controller"]=>
string(5) "Index"
["action"]=>
string(6) "second"
["path"]=>
string(10) "home/index"
}
}
如何獲得陣列中所有的「路徑」的價值觀? 我試圖在PHP中使用array_search
和幾個函數,但這不起作用。
你試過了什麼? – hassan
你有什麼嘗試?你是什麼意思「不起作用」? – hering
[我如何訪問數組/對象?](http://stackoverflow.com/questions/30680938/how-can-i-access-an-array-object) –