I have a two part question…
-
For my file check I need to look to see if the file is present in
$filechkor$dirchk. -
How can I use a wildcard on the file extension
$filename.*when doing a file check?
I’m usingis_filebecause I read that it’s twice as fast when checking if a file exists.
code
$filechk1 = "/temp/files/" . $data[0] . ".doc";
$filechk2 = "/temp/files/" . $data[1] . ".doc";
$dirchk1 = "/temp/files/" . $IDname . $data[0] . ".doc";
$dirchk2 = "/temp/files/" . $IDname . $data[1] . ".doc";
if(is_file($filechk1) && ($filechk2)){
...
}
else { ... }
you should get a list of all of the files in the directory and then check the file extensions – is_file is for a single file only.