response->docs);
?>
Outputs the following:
Array
(
[0] => Object
(
//My Function is worked. Hope help full for you :)
$input = [
'1' => (object) [1,2,3],
'2' => (object) [4,5,6,
(object) [6,7,8,
[9, 10, 11,
(object) [12, 13, 14]]]
],
'3' =>[15, 16, (object)[17, 18]]
];
echo "";
var_dump($input);
var_dump(toAnArray($input));
public function toAnArray(&$input) {
if (is_object($input)) {
$input = get_object_vars($input);
}
foreach ($input as &$item) {
if (is_object($item) || is_array($item)) {
if (is_object($item)) {
$item = get_object_vars($item);
}
self::toAnArray($item);
}
}
}