BZWRITE(3) 1 BZWRITE(3)
bzwrite - Binary safe bzip2 file write
SYNOPSIS
int bzwrite (resource $bz, string $data, [int $length])
DESCRIPTION
bzwrite(3) writes a string into the given bzip2 file stream.
PARAMETERS
o $bz
- The file pointer. It must be valid and must point to a file successfully opened by bzopen(3).
o $data
- The written data.
o $length
- If supplied, writing will stop after $length (uncompressed) bytes have been written or the end of $data is reached, whichever
comes first.
RETURN VALUES
Returns the number of bytes written, or FALSE on error.
EXAMPLES
Example #1
bzwrite(3) example
<?php
$str = "uncompressed data";
$bz = bzopen("/tmp/foo.bz2", "w");
bzwrite($bz, $str, strlen($str));
bzclose($bz);
?>
SEE ALSO
bzread(3), bzopen(3).
PHP Documentation Group BZWRITE(3)