note 22094 added to function.file-exists
| From: | simon__gray at NOSPAM dot hotmail dot com | Date: | Thu, 06 Jun 2002 10:23:52 +0000 |
| Subject: | note 22094 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31528@lists.php.net to get a copy of this message | ||
I found a slight issue when trying to check if a variable name as a directory then variable name as
a file existed.
I was using file_exists('$section/$id.inc.php'); which it didn't seem to like, kept
returning false even though i knew that the file did exist.
A way around this seems to be to try say $somevar = "$section/$id.inc.php";
then do if(file_exists('$somevar')) {
echo "yes"
} else {
echo "no";
};
This seem'd to work.
hope this helps
--
http://www.php.net/manual/en/function.file-exists.php
http://master.php.net/manage/user-notes.php?action=edit+22094
http://master.php.net/manage/user-notes.php?action=delete+22094
http://master.php.net/manage/user-notes.php?action=reject+22094