|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-20 13:30 UTC] ca533512 at tiscali dot cz
I want to read a dir with dir() function and dir to open is like "images/php" then is_file() function doesn't working correctly ... (return false or NULL)
code:
$d = dir("images/php");
while ($file = $d -> read()) {
if (is_file($file)) { // <- this line always return false
...
}
}
when i use chdir() function to change directory, all working correctly ...
Must I use chdir() func. ???
is this a regular feature ???
jenik
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
Yes, it is an expected feature. You have to do if(is_file('images/php/'.$file)). dir() will not chdir so when you call is_file it tries to see if $file is present in your current directory. Not a bug -> Bogus.