Re: FileExists?
| From: | Richard Lynch | Date: | Tue, 08 Nov 2005 23:15:36 +0000 |
| Subject: | Re: FileExists? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225329@lists.php.net to get a copy of this message | ||
On Mon, November 7, 2005 1:45 pm, Gustav Wiberg wrote:
> File_exists doesn't seem to work with URLs that point to another
> domain.
> What to use?
>
> $x = fopen(http://www.stammis.com/getstart.php);
There are no quotes on that URL... I'd be surprised if this doesn't
error out, but maybe you just need E_ALL to see the E_NOTICE you've
been ignoring.
At any rate, you need quotes, whether you realize it or not.
> if file_exists($x) ....
$x, at this point, is either FALSE because fopen() failed, or an open
file handle.
file_exists() expects the path to a file name (a string).
Perhaps you meant:
file_exists("http://www.example.com");
http://php.net/file_exists specifically links to the kinds
of
stream-wrappers that are and aren't supported. Did you read that?
--
Like Music?
http://l-i-e.com/artists.htm