Re: file_exists
| From: | Austin Marshall | Date: | Tue, 07 May 2002 01:39:54 +0000 |
| Subject: | Re: file_exists | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96345@lists.php.net to get a copy of this message | ||
Craig Westerman wrote:
I found my problem. Try fopen() if it fails it will return false, otherwise it will return an integer file pointer. You get use it to fetch files via http://, https://, ftp://, and more.
From manual: "file_exists() will not work on remote files; the file to be examined must be accessible via the server's filesystem. " File is on another server. Is there a way to check if file exists on another server? Craig ><> westerman@chanuteks.com -----Original Message----- From: Craig Westerman [mailto:westerman@chanuteks.com] Sent: Monday, May 06, 2002 7:58 PM To: php-general-list Subject: [PHP] file_exists What am I doing wrong? I get parse error between first echo statement and else. Thanks Craig ><> westerman@chanuteks.com <?php $fn = "image.gif"; if (!file_exists($fn)) { echo "<img src=noimageexists.gif>"; else echo "<img src=$fn>"; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php