note 17781 added to function.file-exists

From: Date: Mon, 24 Dec 2001 02:50:23 +0000
Subject: note 17781 added to function.file-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-23814@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; } ?> -- http://www.php.net/manual/en/function.file-exists.php http://master.php.net/manage/user-notes.php?action=edit+17781 http://master.php.net/manage/user-notes.php?action=delete+17781 http://master.php.net/manage/user-notes.php?action=reject+17781

« previous php.notes (#23814) next »