note 41608 added to function.file-exists

From: Date: Fri, 16 Apr 2004 13:48:42 +0000
Subject: note 41608 added to function.file-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-68205@lists.php.net to get a copy of this message
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 :-) ---- Manual Page -- http://www.php.net/manual/en/function.file-exists.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41608 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41608&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41608&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68205) next »