Is there a way to convert a multidimensional array
to a stdClass
object in PHP?
Casting as (object)
doesn\'t seem to work recu
Late, but just wanted to mention that you can use the JSON encoding/decoding to convert fully from/to array:
//convert object $object into array
$array = json_decode(json_encode($object), true);
//convert array $array into object
$object = json_decode(json_encode($array));
json_encode and json_decode functions are available starting from php 5.2