Description
Here is my current code for demonstrating the purpose. The dev community shall decide on the final verdict.
<?php
function walker($directory) {
foreach (scandir($directory) as $item) {
if ($item == '.' || $item == '..') continue;
if ($directory == "." && ($item == "api.php" || $item == 'index.html')) continue;
$dl[$item] = [
"item_type" => is_dir("{$directory}/{$item}") ? "folder" : "file",
"child" => walker("{$directory}/{$item}"),
];
}
return $dl;
}
?>
Here's how I'm currently using it :) with some html css and js

How it looks like when I use echo and json_encode.

I'll be making a pull request if it got a lot of good impressions.
Description
Here is my current code for demonstrating the purpose. The dev community shall decide on the final verdict.
Here's how I'm currently using it :) with some html css and js

How it looks like when I use echo and json_encode.

I'll be making a pull request if it got a lot of good impressions.