Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * recursive method to convert all arrays to an object
- *
- * @param mixed $array either an array or a string/integer
- *
- * @return array
- */
- private static function _convertToObject($array) {
- if (is_array($array)) {
- foreach ($array as $key => $value) {
- $array[$key] = self::_convertToObject($value);
- }
- return (object)$array;
- }
- return $array;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement