PHP function to convert Multidimensional Arrays to stdClass Objects
<?php
function array2object($myarray) {
if (is_array($myarray)) {
return (object) array_map(__FUNCTION__, $myarray);
}
else {
return $myarray;
}
}
?>
function array2object($myarray) {
if (is_array($myarray)) {
return (object) array_map(__FUNCTION__, $myarray);
}
else {
return $myarray;
}
}
?>
No comments:
Post a Comment