我正在尝试检查文件中是否存在目录列表,如下所示:
<?php
$file = "L:/tmp/file1.txt";
$f = fopen($file, "r");
while ($line = fgets($f,500)) {
$line = str_replace("\\","/",$line);
$found=is_dir($strTest);
if($found) {
echo "<br>the dir $strTest was found";
} else {
echo "<br>the dir $strTest was not found";
}
}
?>
我读的文件是这样的:
L:\tmp\Folder1
L:\tmp\Folder2
L:\tmp\Folder3
L:\tmp\Folder4
结果是 All Folders Not found 除了最后一个....但我确信所有列表都存在