0
我有一個很大的問題,我解決不了它,所以 我有我的數組:創建 - 只需一個鍵=>值
Array
(
[0] => Array
(
[id] => 34
[groupe_id] => 4
[object_id] => 4
)
[1] => Array
(
[id] => 35
[groupe_id] => 4
[object_id] => 5
)
)
現在我想創建另一個數組調用$測試獲得該印版的數組:
Array
(
[object_id] = 4
[object_id] = 5
)
我試過,但沒有結果:
$test = array();
foreach($aObjectsGroupe as $object){
$test[] = array(
'object_id' => $object['object_id']
);
}
所需輸出在PHP中是不可能的,因爲你在同一陣列中具有相同指數的兩倍... – RichardBernards 2014-11-21 15:32:02
你可以試試這個查看詳情【陣列手動](http://php.net/manual/en /language.types.array.php) – 2014-11-21 17:43:43