hi,
i want to open a remote file using fopen() i tried both of these ways
$filename="http://www.domain.com/filename.txt";
$file=fopen($filename,"r");
$filecontents=fread($file,filesize($filename));
this one didn't work because it's apparent that the file isn't in the local
file system so filesize($filename) won't work ...
the second way was this:
$filename="http://www.domain.com/filename.txt";
$file=fopen($filename,"r");
$filecontents="";
while (!feof($file))
{
$filecontents.=fgets($file);
}
this one worked well with PHP4.2.3 but with versions under PHP 4.2.0 it
didn't work
So what else can i try to just get the whole contents of the file into a
string?
thanx
khalid
_________________________________________________________________
Internet access plans that fit your lifestyle -- join MSN.
http://resourcecenter.msn.com/access/plans/default.asp
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- [PHP] Re: fgets() Khalid El-Kary
- [PHP] Re: fgets() Erwin