Possible Duplicate:
How to re-index the values of an array in PHP?
I'm using several php functions to carry c开发者_StackOverflow中文版ertain data over through an array, and through the process I get arrays that print_r like the following:
Array ([0] => 35 [4] => 36 [6] => 34)
What do I have to do if I want to reorder it back to the following? (I use a for statement and need the keys to be in consecutive order starting from 0 again)
Array ([0] => 35 [1] => 36 [2] => 34)
$array = array_values($array);
精彩评论