• PHP Video Tutorials

PHP - bzip2 bzcompress() Function


Advertisements

bzcompress() function can compress a string into bzip2 encoded data.

Syntax

mixed bzcompress( string $source [, int $blocksize = 4 [, int $workfactor = 0 ]] )

bzcompress() function can compress a given string and return it as bzip2 encoded data.

bzcompress() function can return a compressed string or error number in case of error.

Example

<?php
   $str = "sample data";
   $bzstr = bzcompress($str, 9);
   
   echo $bzstr;
?>  
php_function_reference.htm
Advertisements