Include a folder of files using PHP

January 18, 2024


$include_files_path = /root/auto_include_folder';

$filename = '*.php';

if(is_dir($include_files_path) == TRUE){
$include_folder = $include_files_path . ' / ' . $filename;
     foreach(glob($include_folder) as $include_files){
     include $include_files;
     }
}



Comments

There are no comments.


Comment on this Article

Your email address will never be published. Comments are usually approved within an hour or two. (to prevent spam)