我不确定如何处理这个问题的标题,如果有点混乱,很抱歉。
我有一个数组;
Array
(
[username] => Array
(
[0] => 'a'
[1] => 'b'
[2] => 'c'
[3] => 'd'
[4] => 'e'
[5] => 'f'
)
[email] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
[level] => Array
(
[0] => 1
[1] => 1
[2] => 1
[3] => 1
[4] => 1
[5] => 1
)
[role] => Array
(
[0] => 2
[1] => 1
[2] => 1
[3] => 1
[4] => 2
[5] => 1
)
[password] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
[id] => Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
)
)
但我想要这种格式:
Array
(
[0] => Array
(
[username] => 'a'
[id] => 'a'
[email] => 'a'
)
[1] => Array
(
[username] => 'a'
[id] => 'a'
[email] => 'a'
)
[2] => Array
(
[username] => 'a'
[id] => 'a'
[email] => 'a'
)
[3] => Array
(
[username] => 'a'
[id] => 'a'
[email] => 'a'
)
[4] => Array
(
[username] => 'a'
[id] => 'a'
[email] => 'a'
)
[5] => Array
(
[username] => 'a'
[id] => 'a'
[email] => 'a'
)
我似乎无法弄清楚,数组结束得太快,或者索引太多等等。想法?