note 3563 modified in function.fopen by irc-html
| From: | irc-html@php.net | Date: | Wed, 23 Jan 2002 23:37:46 +0000 |
| Subject: | note 3563 modified in function.fopen by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25760@lists.php.net to get a copy of this message | ||
To check if a file exists using http or ftp use the following:
$fp = @fopen("http://www.someurl.com/testfile.php3","r");
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist"; }
Note: The "@" in front of fopen suppresses the error output of the function.
I hope this clears up some confusion.
--was--
To check if a file exists using http or ftp use the following:
<pre>
$fp = @fopen("http://www.someurl.com/testfile.php3","r");
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist"; }
</pre>
Note: The "@" in front of fopen suppresses the error output of the function.
I hope this clears up some confusion.
http://www.php.net/manual/en/function.fopen.php