Last active
November 10, 2015 17:19
-
-
Save patrickmaciel/e957bd57df4d022f2475 to your computer and use it in GitHub Desktop.
Snippet: PHP - Iterate specific file by extension - PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$iterator = new \GlobIterator(YOUR_PATH_HERE . '/*.xls', \FilesystemIterator::KEY_AS_FILENAME); | |
$array = iterator_to_array($iterator); | |
foreach ($array as $file) { | |
echo $file->getFileName() . '<br>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment