I am trying to include .php files from a directory with this type of code. But its not working. Can anyone help me? Thank you.
<?php
$dir = "/file/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while(($file = readdir($dh)) !== false) {
if ($file != "." && $file != "..") {
include "$file";
}
}
closedir($dh);
}
}
?>