php typecast var as array or object code example Example: object to array php $array = (array) $yourObject;