Guest User

Untitled

a guest
Nov 26th, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. function recursiveData(array $array, $level = 1)
  2. {
  3.     $table = "<tbody>";
  4.     foreach ($array as $key => $value) {
  5.         if (!is_array($value)) {
  6.             $table .= "<tr><td>" . $value . "</td></tr>";
  7.         } else {
  8.             recursiveData($value, $level + 1);
  9.         }
  10.     }
  11.     $table .= "</tbody>";
  12.     $table .= "</table>";
  13.     return $table;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment