• PHP Video Tutorials

PHP - bzip2 bzopen() Function



bzopen() function can open a bzip2 compressed file.

Syntax

resource bzopen( mixed $file , string $mode )

bzopen() function can open a bzip2 (.bz2) file for reading or writing.

If the open fails, the bzopen() function can return false, or otherwise, return a pointer to a newly opened file.

Example

<?php
   $file = "/tmp/foo.bz2";
   $bz = bzopen($file, "r") or die("Couldn't open $file for reading");

   bzclose($bz);
?>  
php_function_reference.htm
Advertisements