Re: FileExists?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux