Entry
How can I verify the existence of a file on a remote server?
Jul 18th, 2001 09:16
syberchic, fabio martu, Ben Udall, http://www.php.net/manual/en/features.remote-files.php
As long as support for the "URL fopen wrapper" is enabled when you
configure PHP (as it is by default) and set allow_url_fopen in the
php.ini you can open files by http/ftp protocols and test their
existence with the $file file pointer.
eg.
$file = fopen ("http://www.php.net/", "r");
if (!$file) {
echo "<p>Unable to open remote file.\n";
exit;
}