I have an array $people. When I do print_r($people), I get the following results:
[people] => Array
(
[500] => Array
(
[firstName] => Fred
[age] => 19
)
[501] => Array
(
[firstName] => Bob
[age] => 12
)
[502] => Array
(
[firstName] => Steve
[age] => 52
)
)
I want to change all the keys to look more "normal", starting at 0, then 1, 2 etc. How can I achieve this? To clarify, I want the resulting array to look like this:
[people] => Array
(
[0] => Array
(
[firstName] => Fred
[age] => 19
)
[1] => Array
(
[firstName] => Bob
[age] => 12
)
[2] => Array
(
[firstName] => Steve
[age] => 52
)
)
array_values()which will reset the keys for you:$people['people'] = array_values($people['people']);