convert object array to array php code example
Example 1: php object to array
//This works best
$array = json_decode(json_encode($object), true);
Example 2: php convert array to object
$object = (object) $array;
//This works best
$array = json_decode(json_encode($object), true);
$object = (object) $array;