php set model from an array code example Example: php object to array //This works best $array = json_decode(json_encode($object), true);