I have an array:
Array
(
[0] => ololo
[2] => test
[3] => haha
[7] => nice
)
How can I change the indexes of the array to this:
Array
(
[0] => ololo
[1] => test
[2] => haha
[3] => nice
)
From PHP.net:
array_values() returns all the values from the input array and indexes the array numerically.
$arr = array_values($arr);
array_values() is probably what you want. See: http://php.net/function.array-values
$myArray = array_values($myArray);