Re: [PHP4BETA] [Q] Question about is_dir() function.
| From: | Stanislav Malyshev | Date: | Wed, 09 Feb 2000 15:40:00 +0000 |
| Subject: | Re: [PHP4BETA] [Q] Question about is_dir() function. | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9982@lists.php.net to get a copy of this message | ||
юн>> $dir = "/home/php/public_html/";
юн>> $d = dir($dir);
юн>>
юн>> echo "Handle: ".$d->handle."<br>\n";
юн>> echo "Path: ".$d->path."<br>\n";
юн>> while($entry=$d->read()) {
юн>>
юн>> if ( is_dir($entry) ) {
Here! $entry is a relative path. In the second case, this path is relative
to /dir/, and is_dir returns false, because this file just doesn't exist!
You should check $dir.$entry.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665