I was looking for a solution for this without real success. I have a multidimensional array of parents and children with no depth restrictions. This is created from the database, but the problem is that the identifier of the element becomes the key using my way of placing a flat array in a multidimensional array, for example:
Array( [28] => Array ( [id] => 28 [color] =>
What I would like is a function that performs the following actions:
Array ( [0] => Array ( [id] => 28 [color] =>
Essentially, reassign the keys starting from 0. I tried many methods, but I guess I need to find a recursive solution, and when I tried this, it destroyed my array. I read the array_walk_recursive () function, but I don't quite understand what to do next. Essentially, is there a way to reset numeric keys in a multidimensional array?
Thanks for the help!
flicker
source share