note 25338 deleted from function.opendir by spic

From: Date: Fri, 20 Sep 2002 06:48:46 +0000
Subject: note 25338 deleted from function.opendir by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37014@lists.php.net to get a copy of this message
The manual says: "If path is not a valid directory, opendir() returns FALSE and generates an error." But that is not entirely true. - If you try to use just opendir(), ie without any parameters, you'll get an error; - if you try to use a directory that does not exist, like opendir("/home/false_dir"), you'll get an error; - but if you use a bogus (unset) variable, say, opendir($blahblahblah), opendir will open its script's current directory. May come in handy in shell scripts, if you just want to open the current directory, whatever that is, and always be able to copy/move the script to another place without having to worry about that parameter. Running Windows, PHP 4.2.3.

« previous php.notes (#37014) next »