I have
Array ( [0] => 2088 [1] => 2087 [2] => 2091 [3] => 2083 [4] => 2086 [5] => 2085 [6] => 2084 [7] => 2092 [8] => 2089 [10] => 2122 [11] => 2122 )
As you can see i don't have array key number 9
How can i move other keys down so [9] => 2122 [10] => 2122 ?
Thanks
You can use array_values
to accomplish this
$array = array ( 0 => 2088, 1 => 2087, 2 => 2091, 3 => 2083, 4 => 2086, 5 => 2085, 6 => 2084, 7 => 2092, 8 => 2089, 10 => 2122, 11 => 2122 );
$newarray = array_values($array);
var_dump($newarray);
http://codepad.org/rQkKOp0k
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With