note 17781 deleted from function.file-exists by irc-html
| From: | irc-html@php.net | Date: | Thu, 03 Jan 2002 02:32:17 +0000 |
| Subject: | note 17781 deleted from function.file-exists by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24347@lists.php.net to get a copy of this message | ||
How about this for a cross platform version of the script?
<?
function include_path_file_exists($filename)
{
global $HTTP_ENV_VARS;
$fileDiv = ":";
$slash = "/";
if (isset($HTTP_ENV_VARS["winbootdir"])) {
$fileDiv = ';';
$slash = '\';
}
$paths = explode($fileDiv, ini_get("include_path"));
$result = false;
while( (!($result)) && (list($key,$val) = each($paths)) )
{
$result = file_exists($val . $slash . $filename);
}
return $result;
}
?>