note 25318 added to function.file-exists
| From: | martijn at grendelman dot net | Date: | Thu, 19 Sep 2002 14:50:07 +0000 |
| Subject: | note 25318 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36957@lists.php.net to get a copy of this message | ||
The function below checks the entire include_path for the file:
function my_file_exists($file) {
if (substr($file,0,1) == "/") return file_exists($file);
$incpath = ini_get("include_path");
foreach (explode(":",$incpath) as $path) {
if (file_exists($path."/".$file)) return true;
}
return false;
}
--
http://www.php.net/manual/en/function.file-exists.php
http://master.php.net/manage/user-notes.php?action=edit+25318
http://master.php.net/manage/user-notes.php?action=delete+25318
http://master.php.net/manage/user-notes.php?action=reject+25318