php how to turn xml object to object code example Example: xml to object php $object = json_decode(json_encode(simplexml_load_string($xml)));