RE: [PHP-DEV] Read a file into a string (RE: [PHP-DEV] Sablotron leaks)
| From: | Brian Tanner | Date: | Sun, 24 Jun 2001 20:08:37 +0000 |
| Subject: | RE: [PHP-DEV] Read a file into a string (RE: [PHP-DEV] Sablotron leaks) | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-57855@lists.php.net to get a copy of this message | ||
Doesn't this do that?
$FilePointer=fopen($FileLocation,"r");
$_MyString.=fread($FilePointer,filesize ($FileLocation));
fclose($FilePointer);
Althought I guess this could suck memory pretty hard on large files, and you
guys want to get away from that...
-Brian
> Blah... I see this a lot. We should probably just relent and make a
> function that reads an entire file into a string.
Yes, please do :)