| Article: |
Working with Files in PHP, Part 3 | |
| Subject: | line !== 'false' | |
| Date: | 2003-03-12 16:39:03 | |
| From: | johncogg | |
|
Response to: line !== 'false'
|
||
|
Although this behavior may work (not using the 'identical' comparison and just using a standard comparison) it is not to be relied on. For instance:
|
||
Showing messages 1 through 1 of 1.
-
line !== 'false'
2005-03-17 10:11:01 Cerro [View]



function ListDir($dir)
{
if ((file_exists($dir)) && ($dh = opendir($dir)))
{
while (($file = readdir($dh)) || (((string) $file == "0") || ($file != false)))
echo($file);
closedir($dh);
}
}
In this case the problem directory name is "0" but you can add "false" to the condition.