php directory listing
snippet in php

php get all php files in a directory

user5855

foreach(glob('includes/*.php') as $file) {
    ...
}

php directory listing

user9992

if ($handle = opendir('.')) {

    while (false !== ($entry = readdir($handle))) {

        if ($entry != "." && $entry != "..") {

            echo "$entry\n";
        }
    }

    closedir($handle);
}

php list all files in directory

user4690

scandir ( string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context ]] ) : array