星期一, 10月 04, 2004

[php] 要切實檢查檔名是否存在,因為目錄/檔名可能取成'False'

2003/2/24 01:12下午
The user annotation above it not correct: one should really use 'identical' to check for FALSE, as a directory may be named FALSE as well...

Thus:

while ($file = readdir($handle))

should read

while (false !== ($file = readdir($handle)))