Return to Snippet

Revision: 8195
at September 7, 2008 00:56 by iTony


Initial Code
// Funcion de Objeto a Array
function object_to_array($object)
{
  if(is_array($object) || is_object($object))
  {
    $array = array();
    foreach($object as $key => $value)
    {
      $array[$key] = object_to_array($value);
    }
    return $array;
  }
  return $object;
}

// Funcion de Array a Objeto
function array_to_object($array = array())
{
	return (object) $array;
}

Initial URL

                                

Initial Description

                                

Initial Title
convertion: array to object, object to array

Initial Tags
object, array

Initial Language
PHP