note 25318 deleted from function.file-exists by sniper
| From: | sniper@php.net | Date: | Sun, 23 Nov 2003 01:28:20 +0000 |
| Subject: | note 25318 deleted from function.file-exists by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60842@lists.php.net to get a copy of this message | ||
Note Submitter: martijn@grendelman.net
----
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;
}