PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<bzopenbzwrite>
Last updated: Sat, 20 Oct 2007

bzread

(PHP 4 >= 4.3.3, PHP 5)

bzread -- Binary safe bzip2 file read

说明

string bzread ( resource bz [, int length] )

bzread() reads from the given bzip2 file pointer.

Reading stops when length (uncompressed) bytes have been read or EOF is reached, whichever comes first.

参数

bz

The file pointer. It must be valid and must point to a file successfully opened by bzopen().

length

If not specified, bzread() will read 1024 (uncompressed) bytes at a time.

返回值

Returns the uncompressed data, or FALSE on error.

例子 1. bzread() example

<?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;

?>




<bzopenbzwrite>
 Last updated: Sat, 20 Oct 2007
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 HKT