Created
November 10, 2015 17:12
-
-
Save patrickmaciel/5e30cae73ace50bd04af to your computer and use it in GitHub Desktop.
Iterate files by extension in specific folder
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
$this->info(base_path() . '/*.xls'); | |
$iterator = new \GlobIterator(base_path() . '/*.xls', \FilesystemIterator::KEY_AS_FILENAME); | |
$array = iterator_to_array($iterator); | |
foreach ($array as $file) { | |
echo $file->getFileName(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment