note 15519 deleted from function.file-exists by jimw
| From: | jimw@php.net | Date: | Wed, 02 Jan 2002 01:02:03 +0000 |
| Subject: | note 15519 deleted from function.file-exists by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24081@lists.php.net to get a copy of this message | ||
For testing the existence of a file (remote ones too):
function isAfile($url){
$temp = error_reporting(E_ALL & ~(E_ERROR | E_WARNING | E_PARSE | E_NOTICE |
E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR |
E_USER_WARNING | E_USER_NOTICE));
$file = fopen ("$url", "r");
error_reporting($temp);
if (!$file) return 0;
return 1;
}
Return 1 if file exists, 0 if not.