Return to Snippet

Revision: 7374
at July 19, 2008 18:07 by ki4ngel


Initial Code
// PHP5 only...

function array2object(array $array) {
	$object = new stdClass();
	foreach($array as $key => $value) {
		if(is_array($value)) {
			$object->$key = array2object($value);
		} else {
			$object->$key = $value;
		}
	}
	return $object;
}

Initial URL
http://www.ab-d.fr/date/2008-07-19/

Initial Description

                                

Initial Title
PHP5 - function array2object()

Initial Tags

                                

Initial Language
PHP