$path = '/path/to/directory';
$files = glob($path."/*.txt");
foreach ($files as $file) {
echo $file;
echo '<br>';
}
/* Outputs something like:
/path/to/directory/someFile.txt
/path/to/directory/someOtherFile.txt
/path/to/directory/anotherFile.txt
*/