/ Published in: PHP

Expand |
Embed | Plain Text
function arrayToObject($array, $class = 'stdClass') { return $array; } $object = new $class(); foreach ($array as $key => $value) { $object->$key = self::arrayToObject($value); } return $object; }
You need to login to post a comment.