Return to Snippet

Revision: 55007
at January 21, 2012 05:38 by gabrielsmith


Initial Code
function objectToArray( $object ) {
  if(!is_object($object) && !is_array($object)){
    return $object;
  }
  if(is_object($object)){
    $object = get_object_vars( $object );
  }
  return array_map( 'objectToArray', $object );
}

Initial URL

                                

Initial Description
Converts object to an array

Initial Title
Object to Array

Initial Tags

                                

Initial Language
PHP