how to prepare array of object in php code example Example: cast array to object php $object = (object) $array;