• PHP Video Tutorials

PHP - bzip2 bzwrite() Function



bzwrite() function is a binary-safe bzip2 file write.

Syntax

int bzwrite( resource $bz , string $data [, int $length ] )

bzwrite() function can write a string into a given bzip2 file stream.

bzwrite() function can return the number of bytes written, or false on error.

Example

<?php
   $str = "uncompressed data";
   $bz = bzopen("/tmp/foo.bz2", "w");
   
   bzwrite($bz, $str, strlen($str));
   bzclose($bz);
?>  
php_function_reference.htm
Advertisements