bzdecompress

(PHP 4 >= 4.0.4, PHP 5, PHP 7)

bzdecompressbzip2 인코드 데이터의 압축 해제

설명

mixed bzdecompress ( string $source [, int $small = 0 ] )

bzdecompress()는 주어진 문자열이 포함하는 bzip2 인코드 데이터의 압축을 풉니다.

인수

source

압출을 풀 문자열.

small

TRUE면 메모리를 적게 쓰는 압축 해제 알고리즘을 사용합니다. (최대 메모리 요구 사항이 2300K 정도까지 내려갑니다) 그러나 작업 속도는 거의 절반입니다.

이 기능에 대한 자세한 정보는 » bzip2 문서를 참고하십시오.

반환값

압축 해제한 문자열이나 오류 발생시 오류 번호.

예제

Example #1 문자열 압축 풀기

<?php
$start_str 
"This is not an honest face?";
$bzstr bzcompress($start_str);

echo 
"Compressed String: ";
echo 
$bzstr;
echo 
"\n<br />\n";

$str bzdecompress($bzstr);
echo 
"Decompressed String: ";
echo 
$str;
echo 
"\n<br />\n";
?>

참고

  • bzcompress() - 문자열을 bzip2 인코드 데이터로 압축

add a note add a note

User Contributed Notes 1 note

up
21
balint * atres / ath / cx
18 years ago
I spent a while to sort out some integer results of the bzdecompress, so maybe it'll be useful for somebody else also...
(Constants from the sources.)

#define BZ_OK                0
#define BZ_RUN_OK            1
#define BZ_FLUSH_OK          2
#define BZ_FINISH_OK         3
#define BZ_STREAM_END        4
#define BZ_SEQUENCE_ERROR    (-1)
#define BZ_PARAM_ERROR       (-2)
#define BZ_MEM_ERROR         (-3)
#define BZ_DATA_ERROR        (-4)
#define BZ_DATA_ERROR_MAGIC  (-5)
#define BZ_IO_ERROR          (-6)
#define BZ_UNEXPECTED_EOF    (-7)
#define BZ_OUTBUFF_FULL      (-8)
#define BZ_CONFIG_ERROR      (-9)
To Top