note 23961 added to function.is-dir
| From: | snadra at snadra dot de | Date: | Fri, 02 Aug 2002 10:09:14 +0000 |
| Subject: | note 23961 added to function.is-dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34128@lists.php.net to get a copy of this message | ||
If you just want to check if a dir exists or not (true or false), you can do it like this. Even
though I don't like using @ at all...
But in this case it is the only way to get around the error messages.
<?
if (@is_dir("../yourdir")) {
echo 'is a dir';
} else {
echo 'is not a dir';
}
?>
--
http://www.php.net/manual/en/function.is-dir.php
http://master.php.net/manage/user-notes.php?action=edit+23961
http://master.php.net/manage/user-notes.php?action=delete+23961
http://master.php.net/manage/user-notes.php?action=reject+23961