Re: file checking
| From: | Faisal Nasim | Date: | Fri, 23 Jun 2000 18:52:27 +0000 |
| Subject: | Re: file checking | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2849@lists.php.net to get a copy of this message | ||
| $fp = fopen(
| "http://media.gospelcom.net/mnn/news/2000/06/44-5min-23-06-2000.mp3",
| "r");
|
| if ($fp) {
| print "It's there";
| } else {
| print "It's not there";
| }
|
| If the file exists, it works fine, but if it *doesn't* exist, it prints
| this:
|
|
| Warning:
|
fopen("http://media.gospelcom.net/mnn/news/2000/06/44-5min-23-06-2000.mp3","
r")
| - Success in /usr/local/www/gospelcom/docs/mnn/mnn/beta/remotetest.php on
| line 5
To suppress the warning put '@' before fopen.
$fp = @fopen ( .... )
Enjoy!
Faisal