Created
March 18, 2017 02:48
-
-
Save omarkdev/5efcf72f31b939b22b0296451050c8d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('array_to_object')) { | |
function array_to_object(Array $data) | |
{ | |
$data = array_map( function ($item) { | |
if (is_array($item)) { | |
$item = array_to_object($item); | |
} | |
return $item; | |
}, $data); | |
return (Object) $data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment