/ Published in: PHP
coolstuff.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$i = 0; foreach($object->all as $o){ $retArray[$i] = $o->_to_array(); foreach($includes as $include){ foreach($o->{$include}->get()->all as $inc){ $retArray[$i][$include][] = $inc->_to_array(); } } } ++$i; } return $retArray; }