how to convert a class object to an array in php code example Example: object to array php $array = (array) $yourObject;