note 41608 deleted from function.file-exists by vincent
| From: | vincent@php.net | Date: | Fri, 16 Apr 2004 13:50:29 +0000 |
| Subject: | note 41608 deleted from function.file-exists by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68207@lists.php.net to get a copy of this message | ||
Note Submitter: roy at sinclair design dot com
----
For ages I have been successfully using lines like this:
<?php if (file_exists($directory."/".$file)) { ?>
but today it is consistently giving me false positives on all manner of different filename formats.
After pulling my hair out for a while I wrapped the file path in single quotes and hey-presto: it
works.
<?php if (file_exists('$directory/$file')) { ?>
Hope that helps someone :-)