PHP: glob

Posted in PHP
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.

Related PHP Posts

June 2024

Popular PHP frameworks

Here’s detailed look at some of the most popular PHP frameworks, each of which can help speed up development, improve code organisation, and enhance application...

Continue reading

March 2024

PHP Security in 2024: navigating the evolving landscape

As PHP continues to evolve, so do the threats that target its vulnerabilities. Ensuring robust PHP security practices is paramount to safeguarding sensitive data and...

Continue reading

December 2022

Quick start guide for Laravel on a PHP server

Laravel is a powerful and popular PHP framework designed to make web development easier and more efficient. This quick start guide will help you set...

Continue reading

More PHP Posts