I know we have duplicates of this but still not getting exact solution. Here is my code
if ($lib_dir = @opendir($_SERVER["DOCUMENT_ROOT"]."/lib")) {
while (false !== ($lib_file = readdir($lib_dir))) {
if ((preg_match("/\.php$/", $lib_file)) & ($lib_file!="loader.php"))
{
include_once($_SERVER["DOCUMENT_ROOT"]."/lib/$lib_file");
}
}
closedir($lib_dir);
}
Thanx in advance