Search code examples
phparrays

How to reindex an associative array?


Had a hard time wording this in google so I figure ill ask here.

I have an array like such:

Array ( [a] => 'a' [b] => 'b' [c] => 'c' )

Is there an easy way to convert the keys to numerical values like such? Is there a built in function, or will I have to make one?

Array ( [0] => 'a' [1] => 'b' [2] => 'c' )

Solution

  • You want the array_values function.