Guest User

Untitled

a guest
May 7th, 2012
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2. function printMenu ($pages)
  3. {
  4. echo '<ul>';
  5. foreach ($pages as $page)
  6. {
  7. printf('<li><a href="page.php?id=%d">%s</a>',
  8. $page['id'],
  9. $page['name']);
  10. if (is_array($page['childs']) && (count($page['childs'] > 0))
  11. printMenu($page['childs']);
  12. echo '<\li>';
  13. }
  14. echo '<\ul>';
  15. }
Advertisement
Add Comment
Please, Sign In to add comment