📅  最后修改于: 2022-03-11 14:54:31.888000             🧑  作者: Mango
$path = '/path/to/directory';
$files = glob($path."/*.txt");
foreach ($files as $file) {
echo $file;
echo '
';
}
/* Outputs something like:
/path/to/directory/someFile.txt
/path/to/directory/someOtherFile.txt
/path/to/directory/anotherFile.txt
*/