Answers for "need to find all php files in a specific folder"

PHP
4

php get all php files in a directory

foreach(glob('includes/*.php') as $file) {
    ...
}
Posted by: Guest on March-21-2020
0

require all files in directory php

foreach (scandir(dirname(__FILE__)) as $filename) {
    $path = dirname(__FILE__) . '/' . $filename;
    if (is_file($path)) {
        require $path;
    }
}
Posted by: Guest on September-02-2021

Code answers related to "need to find all php files in a specific folder"

Browse Popular Code Answers by Language