bzcompress

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

bzcompressCompress a string into bzip2 encoded data

Description

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

bzcompress() compresses the given string and returns it as bzip2 encoded data.

Parameters

source

The string to compress.

blocksize

Specifies the blocksize used during compression and should be a number from 1 to 9 with 9 giving the best compression, but using more resources to do so.

workfactor

Controls how the compression phase behaves when presented with worst case, highly repetitive, input data. The value can be between 0 and 250 with 0 being a special case.

Regardless of the workfactor, the generated output is the same.

Return Values

The compressed string, or an error number if an error occurred.

Examples

Example #1 Compressing data

<?php
$str 
"sample data";
$bzstr bzcompress($str9);
echo 
$bzstr;
?>

See Also

add a note add a note

User Contributed Notes 2 notes

up">Report a Bugss="votes"> d
eases/feeVphp'="">!decompres ">Report a Bugss="vot /diyiv claV # uprz23 at gn/re'="givinmpressing daclascompresr# &> ; dacl"votdnk reles/fee2010-06-24 12:52lass="func7 years agompressing d
w3.o> ng>Eacksizgage=funct/gz&ams="dc-tit copage=funct/rdfs-seeAlsokfactobzivinbo abrat 5x slowassthodegz.>?>
0483ot id="Vu/ed stringpress>zions 0483t/?prooblem&manpage=functt/?prngpr=uleases/feeVphp'up!decompres up">Report a Bugss="votes"> d 0483ot id="Vu/ed stringpress>zions 0483t/?prooblem&manpage=functt/?prngpr=="">eases/feeVphp'="">!decompres ">Report a Bugss="vot /diyiv claV 0483oases/fee75% like is...iv id="2li> # 0483oaul> diego2'>div engass redsemmlass redempressing daclascompresr# 0483ote&> ; dacl"votdnk reles/fee2009-04-24 03:01lass="func8 years agompressing d
w3.o> T Specifies neeses bz[2]dt> nearly outp, beca just 189 058 Byhp' bzip The stri t coin iseing bz[2]dt> Funcoin spee.ph cotrols how thode>and biggassaturesor: #00r: #0 s="paramet c" hreflput dat 30. dt>?< >? c ml xmln Dec"http:.0.3php.n/low-level.hp.n#ect1-functi> ml xmln Dec"http:.0.3php.n/low-level.hp.n#ect1-functi> >
foot class="action">add a note add a notel> <>i> div> <>![en
'
'childrkbox" cla'a> dd> cla/div> dd> cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> to sear dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> a> dd> cla/div> rev"> Eiv> r/Involved cla/div> /a> dd> cla/divr/Involved cla/div> /a> 00sp'>G he gene dd>ss="voton ieferssfooterion id="layoua>ss="votrow-fluidlayoua>ss=s="para"> footkboxme="changelaa> "panpyr widl/en/rCnpyr wid &anpy; 2001-2017ass="4.0.Grou