Sometimes we need to convert object to array in PHP
so here it is
enjoy
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; }
Reblogged this on kontinuiti.
Reblogged this on ITechonology
nice algorithm bro, i added at cms helper