Following function has easily to convert an associative array from object data
function object_to_array($result) { $arraydata = array(); foreach ($result as $key=>$value) { if (is_object($value)) { $arraydata [$key]=object_to_array($value); } elseif (is_array($value)) { $arraydata [$key]=object_to_array($value); } else { $arraydata [$key]=$value; } } return $arraydata ; }
No comments:
Post a Comment