Re: Newbie Question ?? (read distant file)
| From: | Chris Hayes | Date: | Tue, 08 Apr 2003 12:17:31 +0000 |
| Subject: | Re: Newbie Question ?? (read distant file) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142846@lists.php.net to get a copy of this message | ||
At 10:00 8-4-03, you wrote:
Hi I would like to open or read ? a *.txt file from a http:// address read a few lines and then process. What do I use is it fopen or ?Yes, fopen can handle http: addresses, it's in the manual on http://www.php.net/manual/en/function.fopen.php or you could get the entire file in a variable with
ob_start();
include("http:/.,...file.txt");
$content= ob_get_contents();
ob_end_clean();
Maybe worth your time: http://www.php.net/manual/en/features.remote-files.php