Dosya birden çok yerde var olmadığını görmek için kontrol edin

0 Cevap

Ben bir iki bir sorum var ...

  1. Benim dosya kontrol için ben dosya $filechk veya $dirchk mevcut olup olmadığını görmek için bakmak gerekir.

  2. How can I use a wildcard on the file extension $filename.* when doing a file check? I'm using is_file because 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 { ... }

0 Cevap