Last active
February 24, 2016 14:26
-
-
Save Foxy79/4c2ddb685845bdeb77ef to your computer and use it in GitHub Desktop.
This file contains 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 | |
function object_to_array($data) { | |
if (is_array($data) || is_object($data)) { | |
$result = array(); | |
foreach ($data as $key => $value) { $result[$key] = object_to_array($value); } | |
return $result; | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment