我在這裏有一個問題。比方說,我有一種形式的數組:數組索引操作php
Array
(
[0] => Array
(
[0] => Array
(
[A] => Array
(
[id] => 1
[firstname] => John
[lastname] => Smith
[email] => [email protected]
)
[B] => Array
(
)
)
)
[1] => Array
(
[0] => Array
(
[A] => Array
(
[id] => 2
[firstname] => Tommy
[lastname] => Tom
[email] => [email protected]
)
[B] => Array
(
)
)
)
)
我怎樣才能通過內部數組的索引,以便更換外數組的索引有一個這樣的數組:
Array
(
[0] => Array
(
[A] => Array
(
[id] => 1
[firstname] => John
[lastname] => Smith
[email] => [email protected]
)
[B] => Array
(
)
)
[1] => Array
(
[A] => Array
(
[id] => 2
[firstname] => Tommy
[lastname] => Tom
[email] => [email protected]
)
[B] => Array
(
)
)
)
提前致謝!
不知道爲什麼有人downvoted這一點,似乎是一個合理的問題給我。 – 2012-01-16 16:37:41
我可以在兩者中看到的區別是第三級數組成爲第二級數組。你有沒有試過簡單地去:'不尋常的陣列[0] =不尋常的陣列[0] [0]'? – 2012-01-16 16:42:43