PHP - bzip2 bzwrite() 函式



bzwrite() 函式是一個二進位制安全的 bzip2 檔案寫入函式。

語法

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

bzwrite() 函式可以將字串寫入給定的 bzip2 檔案流。

bzwrite() 函式可以返回寫入的位元組數,或者在出錯時返回 false。

示例

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