I am gathering list of files in given folder, where there might be files and folders.
I can manually skip folder when I want, but how can I skip ALL folders automatically and store only files in the array?
$moduleArray = array_diff(scandir('module/', 1), array('..', '.', 'admin'));
Well, I got this... But any way to do it while searching using scandir
?
foreach($moduleArray as $module) {
$end = explode(".", $module);
if(end($end) == "php") {
$name = substr($module, 0, -8);
echo " <a href=\"index.php?page=$name\"> $name </a><br />";
}
}