开发者

PHP Bz2 extension question

When I am using bzopen, do I need to bzwrite() alre开发者_StackOverflowady compressed by a bzcompress() string or is it being compressed automatically while writing?


Judging by Example #1 on the manual page of bzwrite (quoting) :

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

I would say there is no need to compress data yourself with bzcompress before using bzwrite.


Also, executing this portion of code will create a file with content that looks like this :

$ cat /tmp/foo.bz2
BZh91AY&SY7�w�@.� 1�&2��� q�o
|]��B@���`

Doesn't look like "uncompressed data" -- and looks like some bzip2-compressed data ;-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜