Converting array and objects in array to pure array

Just use this :

json_decode(json_encode($yourArray), true);

Have you tried typecasting?

$array = (array) $object;

There is another trick actually

$json  = json_encode($object);
$array = json_decode($json, true);

You can have more info here json_decode in the PHP manual, the second parameter is called assoc:

assoc

When TRUE, returned objects will be converted into associative arrays.

Which is exactly what you're looking for.

You may want to try this, too : Convert Object To Array With PHP (phpro.org)

Tags:

Php

Arrays