Using glob() : glob « File Directory « PHP
- PHP
- File Directory
- glob
Using glob()
<?php
foreach (glob('/usr/local/docs/*.txt') as $file) {
$contents = file_get_contents($file);
print "$file contains $contents\n";
}
?>
Related examples in the same category