Sephiroth wrote:
> Hi all,
>
> How to access remote files with php?
> For ex:
> $sFile = "http://www.php.net/123.txt";;
> if (file_exists($sFile)) {
>   $hFile = fopen($sFile);
>   ...
>   fclose($hFile);
> }

At the risk of being accused of copying whatshisname...

"Yes."

:-)

You're pretty much written the code in its most simple form the way it
should be, and it should work as-is.

You'd want to add in some error-checking code so your application does
something reasonable when the file isn't found, or the network connection
flakes out, or...

PS file_exists() may only work for URLs in recent versions of PHP...  Read
the manual to find out which versions.

-- 
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

Reply via email to