note 36959 modified in function.file-exists by vincent
| From: | vincent@php.net | Date: | Thu, 27 Nov 2003 17:07:25 +0000 |
| Subject: | note 36959 modified in function.file-exists by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61037@lists.php.net to get a copy of this message | ||
If you are trying to check whether a remote file (or url) exists, you can open it and close it in
the same statement.
<?php
if (@fclose(@fopen("http://www.example.com",
"r"))) {
print("File exists.");
} else {
print("File does not exist.");
}
?>
--was--
If you are trying to check whether a remote file (or url) exists, you can open it and close it in
the same statement.
<?php
if (@fclose(@fopen("http://www.example.com",
"r"))) {
print("File exists.);
} else {
print("File does not exist.");
}
?>
http://www.php.net/manual/en/function.file-exists.php