php convert object to array full code example
Example 1: php object to array
//This works best
$array = json_decode(json_encode($object), true);
Example 2: object to array php
//It is verry easy : just cast object to array
$array = (array)$object;