PHP - bzip2 bzopen() 函数


bzopen() 函数可以打开 bzip2 压缩文件。

语法


resource bzopen( mixed $file , string $mode )

bzopen() 函数可以打开 bzip2(.bz2) 文件进行读取或写入。

如果打开失败,bzopen() 函数可以返回 false,否则,返回指向新打开文件的指针。

示例


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

   bzclose($bz);
?>