Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. function displayArray(array $array, int $depth)
  2. {
  3.     foreach ($array as $key => $value) {
  4.         if (is_array($value)) {
  5.             // C'est un tableau
  6.             echo ' --- ' . $key . " --- \n";
  7.             displayArray($value, $depth++);
  8.         } else {
  9.             // Affichage
  10.             echo $key . ' = ' . $value . "\n";
  11.         }
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement