Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. output:
  2. (
  3. google.com => Array(
  4. 0 => cloud
  5. )
  6. microsoft.com => Array(
  7. office => Array(word,excel),
  8. azur
  9. )
  10. )
  11.  
  12. function recursive_loop($array)
  13. {
  14. foreach($array as $key => $value)
  15. {
  16. if((is_array($value)))
  17. {
  18. recursive_loop($value);
  19. }
  20. else
  21. {
  22. echo $value . PHP_EOL;
  23. }
  24. }
  25.  
  26. }
  27.  
  28. echo recursive_loop($food);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement