note 100163 added to function.gzdecode
| From: | DaveB at osu1 dot php dot net | Date: | Wed, 29 Sep 2010 01:46:24 +0000 |
| Subject: | note 100163 added to function.gzdecode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172793@lists.php.net to get a copy of this message | ||
yet another version... tried to keep it simple. the catch is that it's already expected to be
in a file. Works similar to file_get_contents and should be thread-safe.
<?php
//custom version of the gzdecode string
function gzfile_get_contents($filename)
{
$h = gzopen($filename,'r');
while($tempdata = gzread($h,1024*1024*2)) //read 2 MB at a time
{
$data .= $tempdata;
}
gzclose($h);
return $data;
}
?>
----
Server IP: 208.69.120.55
Probable Submitter: 97.81.113.155
----
Manual Page -- http://www.php.net/manual/en/function.gzdecode.php
Edit -- https://master.php.net/note/edit/100163
Del: integrated -- https://master.php.net/note/delete/100163/integrated
Del: useless -- https://master.php.net/note/delete/100163/useless
Del: bad code -- https://master.php.net/note/delete/100163/bad+code
Del: spam -- https://master.php.net/note/delete/100163/spam
Del: non-english -- https://master.php.net/note/delete/100163/non-english
Del: in docs -- https://master.php.net/note/delete/100163/in+docs
Del: other reasons-- https://master.php.net/note/delete/100163
Reject -- https://master.php.net/note/reject/100163
Search -- https://master.php.net/manage/user-notes.php