(PHP 4 >= 4.0.4, PHP 5, PHP 7)
bzread — bzip2 锟侥硷拷锟斤拷锟斤拷锟狡帮拷全锟截讹拷取
$bz
[, int $length
= 1024
] ) : stringbzread() 锟斤拷指锟斤拷锟斤拷 bzip2 锟侥硷拷指锟斤拷锟叫讹拷取锟斤拷锟捷★拷
锟斤拷取锟斤拷 length
锟斤拷未锟斤拷压锟斤拷锟侥筹拷锟饺o拷锟斤拷锟街节o拷锟斤拷锟竭碉拷锟侥硷拷尾锟斤拷取锟斤拷锟斤拷锟饺碉拷锟侥革拷锟斤拷
bz
锟侥硷拷指锟诫。锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷效锟侥诧拷锟斤拷指锟斤拷 bzopen() 锟缴癸拷锟津开碉拷锟侥硷拷锟斤拷
length
锟斤拷锟矫伙拷锟斤拷峁╋拷锟� bzread() 一锟轿伙拷锟斤拷锟� 1024 锟斤拷锟街节o拷未锟斤拷压锟斤拷锟侥筹拷锟饺o拷锟斤拷 一锟斤拷锟斤拷锟缴讹拷锟斤拷 8192 锟斤拷未压锟斤拷锟斤拷锟街节★拷
锟斤拷锟截斤拷压锟斤拷锟斤拷锟捷o拷锟节达拷锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 bzread() 锟斤拷锟斤拷
<?php
$file = "/tmp/foo.bz2";
$bz = bzopen($file, "r") or die("Couldn't open $file");
$decompressed_file = '';
while (!feof($bz)) {
$decompressed_file .= bzread($bz, 4096);
}
bzclose($bz);
echo "The contents of $file are: <br />\n";
echo $decompressed_file;
?>