note 10565 deleted from function.opendir by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 23:43:18 +0000 |
| Subject: | note 10565 deleted from function.opendir by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22362@lists.php.net to get a copy of this message | ||
This doesn't appear to work properly if you aren't in the my_dir directory:
<pre>
$path = "/home/web_site/www/my_dir";
$main = opendir($path);
while($file = readdir($main)) {
... statements ...
}
closedir($main);
</pre>
however, if you add the chdir(), it works great:
<pre>
$path = "/home/web_site/www/my_dir";
chdir($path);
$main = opendir($path);
while($file = readdir($main)) {
... statements ...
}
closedir($main);
</pre>