PHP: glob

glob($string);

Return an array of pathnames matching a specific pattern.

// Find all CSV files in the /home/var/imports/ directory 
glob("/home/var/imports/hello-*.csv");
  • /home/var/imports/hello-world.csv – Returned
  • /home/var/imports/hell-world.csv – Not returned
  • /home/var/imports/hello-.csv – Returned.