Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. function recursive($parent, $children) {
  2.     foreach ($children as $child) {
  3.         if ($parent->id == $child->parent->id) {
  4.             echo 'child: ' . $child->name . ' parent:' . $child->parent->name . '<br>';
  5.  
  6.             recursive($child, $child->children()->get());
  7.         }
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement