note 28930 deleted from function.file by philip
| From: | philip@php.net | Date: | Thu, 30 Jan 2003 22:07:37 +0000 |
| Subject: | note 28930 deleted from function.file by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43160@lists.php.net to get a copy of this message | ||
The below example posted by Dan - predicted_loser(at)msn.com should NOT be used!
To get the contents of a remote file into a string...
<?php
$line = file("http://example.com");
foreach($line as $nline){
$content="$content$nline";
}
echo $content;
?>
Use
<?
$content=join("\n",file("http://example.com"));
echo $content;
?>
or as of PHP 4.3
<?
$content=file_get_contents("http://example.com");
echo $content;
?>