/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function arrayToObject($array, $class = 'stdClass') { return $array; } $object = new $class(); foreach ($array as $key => $value) { $object->$key = self::arrayToObject($value); } return $object; }
Comments
