I\'m integrating an API to my website which works with data stored in objects while my code is written using arrays.
I\'d like a quick-and-dirty function to convert
Short solution of @SpYk3HH
function objectToArray($o) { $a = array(); foreach ($o as $k => $v) $a[$k] = (is_array($v) || is_object($v)) ? objectToArray($v): $v; return $a; }