Skip to content

Instantly share code, notes, and snippets.

@0xnbk
Created August 7, 2010 09:26
Show Gist options
  • Save 0xnbk/512625 to your computer and use it in GitHub Desktop.
Save 0xnbk/512625 to your computer and use it in GitHub Desktop.
glob()
<?php
foreach (glob("*.php") as $file)
echo "$file\n";
?>
@0xnbk
Copy link
Author

0xnbk commented Sep 13, 2010

glob() will make you feel stupid after using opendir(), readdir() and closedir() to search for a file. It’s this simple:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment