我有这个多维数组 我想知道如何再次对该数组进行排序,以便可以在 for 循环中使用它。
array (size=3)
0 =>
array (size=1)
0 =>
array (size=7)
'username' => string 'wajdi' (length=5)
'userimage' => string 'file_3898.jpg' (length=13)
'date' => int 1373721708
'postid' => string '118' (length=3)
'type' => string 'comment' (length=7)
'comment' => string 'a' (length=1)
'notify' => string '0' (length=1)
2 =>
array (size=1)
2 =>
array (size=7)
'username' => string 'wajdi' (length=5)
'userimage' => string 'file_3898.jpg' (length=13)
'date' => int 1373721711
'postid' => string '118' (length=3)
'type' => string 'comment' (length=7)
'comment' => string 'c' (length=1)
'notify' => string '0' (length=1)
3 =>
array (size=1)
3 =>
array (size=7)
'username' => string 'wajdi' (length=5)
'userimage' => string 'file_3898.jpg' (length=13)
'date' => int 1373721712
'postid' => string '118' (length=3)
'type' => string 'comment' (length=7)
'comment' => string 'd' (length=1)
'notify' => string '0' (length=1)
我怎样才能重新索引这个数组成为
array (size=3)
0 =>
array (size=1)
0 =>
array (size=7)
'username' => string 'wajdi' (length=5)
'userimage' => string 'file_3898.jpg' (length=13)
'date' => int 1373721708
'postid' => string '118' (length=3)
'type' => string 'comment' (length=7)
'comment' => string 'a' (length=1)
'notify' => string '0' (length=1)
1 =>
array (size=1)
1 =>
array (size=7)
'username' => string 'wajdi' (length=5)
'userimage' => string 'file_3898.jpg' (length=13)
'date' => int 1373721711
'postid' => string '118' (length=3)
'type' => string 'comment' (length=7)
'comment' => string 'c' (length=1)
'notify' => string '0' (length=1)
2 =>
array (size=1)
2 =>
array (size=7)
'username' => string 'wajdi' (length=5)
'userimage' => string 'file_3898.jpg' (length=13)
'date' => int 1373721712
'postid' => string '118' (length=3)
'type' => string 'comment' (length=7)
'comment' => string 'd' (length=1)
'notify' => string '0' (length=1)
我尝试了 array_shift 和 array_chunk 但没有任何效果!请大家帮忙,谢谢大家:)