我有一个像:
这样的数组Array
(
[6] => Array
(
[quantity] => 23
[orgId] => 6
[validity] => 20
)
[2] => Array
(
[quantity] => 5
[orgId] => 2
[validity] => 2
)
[5] => Array
(
[quantity] => 5
[orgId] => 5
[validity] => 4
)
[4] => Array
(
[quantity] => 7
[orgId] => 4
[validity] => 10
)
)
我希望像这样表明:
Array
(
[0] => Array
(
[quantity] => 23
[orgId] => 6
[validity] => 20
)
[1] => Array
(
[quantity] => 5
[orgId] => 2
[validity] => 2
)
[2] => Array
(
[quantity] => 5
[orgId] => 5
[validity] => 4
)
[3] => Array
(
[quantity] => 7
[orgId] => 4
[validity] => 10
)
)
为此,我使用了array_push&其他一些技术却失败了。 有人可以帮我谢谢。
答案 0 :(得分:8)
答案 1 :(得分:0)
是的array_values就是答案,你也可以通过这个讨论http://www.codingforums.com/archive/index.php/t-17794.html