std object php to array code example Example 1: php convert array to object $object = (object) $array; Example 2: object to array php $array = (array) $yourObject;