Using glob() : glob « File Directory « PHP






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

1.Using the glob() Function
2.glob() Constants