RE: [PHP-DEV] PHP 4.0 Bug #5008: readfile(), flag to read file into a string
| From: | Mike Robinson | Date: | Tue, 13 Jun 2000 17:45:48 +0000 |
| Subject: | RE: [PHP-DEV] PHP 4.0 Bug #5008: readfile(), flag to read file into a string | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-21226@lists.php.net to get a copy of this message | ||
Sorry, that one got away from me...
>
> > It would be useful if readfile() was able to read a file into a
> > string in addition to read it into an array...
>
> readfile() doesn't read a file into an array, it outputs a file to stdout.
> file() reads a file into an array. Using it to read a file into a string
> can be accomplished with the simple example given in the manual for the
> file(0 function:
>
$fcontents = join( '', file( 'http://www.php.net' ) );
would read a file into a string.
.mike