Is there a way to convert a multidimensional array to a stdClass object in PHP?
array
stdClass
Casting as (object) doesn\'t seem to work recu
(object)
The shortest I could come up with:
array_walk_recursive($obj, function (&$val) { if (is_object($val)) $val = get_object_vars($val); });