0
我有這樣的陣列如何從這個數組
[InstrumentCategory] => Array
(
[0] => Array
(
[id] => 4
[title] => Training
[InstrumentsCategory] => Array
(
[id] => 56
[instrument_id] => 28
[category_id] => 4
)
)
[1] => Array
(
[id] => 8
[title] => Working time flexibility
[InstrumentsCategory] => Array
(
[id] => 57
[instrument_id] => 28
[category_id] => 8
)
)
[2] => Array
(
[id] => 16
[title] => Income support for workers
[InstrumentsCategory] => Array
(
[id] => 55
[instrument_id] => 28
[category_id] => 16
)
)
)
提取關鍵=>值對是否有其他方法來提取ID => value對(注意id
在這種情況下是在子的關鍵 - 陣列)比for
循環?
預先感謝
當然,直接訪問,如果你知道所有的父數組鍵。否則,不。 –
具有遞歸功能? – yoda
你是如何「提取」id =>值的?你事先知道你想要什麼價值?或者相反,你知道什麼是找到值的關鍵(即:'InstrumentCategory [0] [0]' – Jakub