有人可以解释为什么,在这种情况下,scandir 正在获取我的目录,但是 glob 正在获取......好吧,它似乎正在获取路径:
$directory = "../../../XXXXXXXXXXXXXX/media/csv";
使用扫描目录:
$files = scandir($directory);
print_r($files);
结果:
Array ( [0] => . [1] => .. [2] => myCsv.csv [3] => index.html )
使用 Glob:
$files = glob($directory . "*"); # i wanted to select only CSV, but it returned empty. so i placed a *.
结果:
Array ( [0] => ../../../XXXXXXXXXXXXXX/media/csv )