I need a way to make a loop for the section in red below. I tried to write a loop, but it won't allow it. The $reqfiles is an array of 4 names ($reqfiles = array("1.php", "2.php", "3.php", "4.php"
;) specified earlier in the code which I would like to add to in the future without having to add another of the lines in red each time.
Any ideas?
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function checkFileName($f) {
global $subdir, $thisfile, $hidedotfiles, $hidefilepattern, $trashcan, $trashcaninfofileext, $showimagesdir, $imagesdir, $readmefile, $loginfile, $logoutfile, $showreadmefile, $showloginfile, $showlogoutfile, $filealiases, $filealiasext,$reqfiles,$showreqfiles;
$f = basename($f);
return !( (($subdir == ""
&& (strtolower($f) == $thisfile))
|| (($subdir == ""
&& ($f == $trashcan))
|| (!$showimagesdir && ((($subdir == ""
&& ($f == $imagesdir)) || ($subdir == $imagesdir)))
|| ($hidedotfiles && ($f[0] == '.'))
|| (($hidefilepattern != ""
&& ereg($hidefilepattern, $f))
|| ($filealiases && ereg("^.*\.".strtolower($filealiasext)."$", strtolower($f)))
|| ($f == ".."
|| (!$showreadmefile && ($f == $readmefile)) // hides the readme file
|| (!$showloginfile && ($f == $loginfile)) // hides the login file
|| (!$showlogoutfile && ($f == $logoutfile)) // hides the logout file
|| (!$showreqfiles && ($f == $reqfiles[0]))
|| (!$showreqfiles && ($f == $reqfiles[1]))
|| (!$showreqfiles && ($f == $reqfiles[2]))
|| (!$showreqfiles && ($f == $reqfiles[3]))
|| (($subdir == $trashcan) && (($f == $readmefile) || ereg(".*\.".strtolower($trashcaninfofileext)."$", strtolower($f)))) );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////

Any ideas?
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function checkFileName($f) {
global $subdir, $thisfile, $hidedotfiles, $hidefilepattern, $trashcan, $trashcaninfofileext, $showimagesdir, $imagesdir, $readmefile, $loginfile, $logoutfile, $showreadmefile, $showloginfile, $showlogoutfile, $filealiases, $filealiasext,$reqfiles,$showreqfiles;
$f = basename($f);
return !( (($subdir == ""

|| (($subdir == ""

|| (!$showimagesdir && ((($subdir == ""

|| ($hidedotfiles && ($f[0] == '.'))
|| (($hidefilepattern != ""

|| ($filealiases && ereg("^.*\.".strtolower($filealiasext)."$", strtolower($f)))
|| ($f == ".."

|| (!$showreadmefile && ($f == $readmefile)) // hides the readme file
|| (!$showloginfile && ($f == $loginfile)) // hides the login file
|| (!$showlogoutfile && ($f == $logoutfile)) // hides the logout file
|| (!$showreqfiles && ($f == $reqfiles[0]))
|| (!$showreqfiles && ($f == $reqfiles[1]))
|| (!$showreqfiles && ($f == $reqfiles[2]))
|| (!$showreqfiles && ($f == $reqfiles[3]))
|| (($subdir == $trashcan) && (($f == $readmefile) || ereg(".*\.".strtolower($trashcaninfofileext)."$", strtolower($f)))) );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////