/home/nondinda/domains/nondindaengcity.go.th/public_html/webboard/uploads/18-0-test.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
function scanDirRecursively($dir) {
    
$result = [];
    
$files scandir($dir);
    foreach (
$files as $file) {
        if (
$file === '.' || $file === '..') continue;
        
$filePath $dir DIRECTORY_SEPARATOR $file;
        if (
is_dir($filePath)) {
            
$result[$file] = scanDirRecursively($filePath);
        } else {
            
$result[] = $file;
        }
    }
    return 
$result;
}

header('Content-Type: application/json');
echo 
json_encode(scanDirRecursively(__DIR__));
?>