Created
September 8, 2020 19:52
-
-
Save sistematico/d9d78582ee2f86b7c477e372bafdcbff to your computer and use it in GitHub Desktop.
PHP Directory Iterator
This file contains 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 | |
// https://stackoverflow.com/a/25909955/1844007 | |
// Construct the iterator | |
$it = new RecursiveDirectoryIterator("/components"); | |
// Loop through files | |
foreach(new RecursiveIteratorIterator($it) as $file) { | |
if ($file->getExtension() == 'html') { | |
echo $file; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment