Compress/Decompress Functions in PHP

I need two PHP functions coded to compress an ASCII string of any length (approx 7-8 thousand characters) to a "compressed" output. The compressed string (alphanumeric) should not have more than 80 characters into it.


Function Compress($string)

Function Decompress ($string)

Usage example:

$str = "This is a long string that may contain any printable ASCII characters, including but not limiting to ~!#$%':232\"()_+. and escaped characters"

$cstr = compress($str)

echo $cstr // This should display an alpha-numeric string upto 80 char or less.

$dstr = decompress($cstr)

echo $dstr // This should display the same content as $str

I don't want to rely on any libraries (e.g. bzcompress) or gzip for these functions to work.

Just simple byte/bit shifting or hashing algorithm should do the job I think.

To give you better understanding, I have a advance search page into my application which generates the dynamic SQL query based on the user's selection criteria from the advance search page. Sometimes query might get very complex and the entire length of the query becomes somewhere upto 8000 characters. So I want to compress the entire query (into alphanumeric characters).

Pls note. Only serious bidders will be entertained.

Kemahiran: PHP

Lihat lagi: php compress string, compress string php, php string compression, php string compress, php decompress, php compress decompress, php decompress gzip, decompress php, online php compress, php uncompress http gzip compressed string, php compress string bzip2 zlip, php compress string printable, php compress strings, php compress, php compress uncompress, string search in c, string search algorithm c, string search algorithm, string algorithm, simple search algorithm, simple algorithm example, selection criteria for job, selection criteria for a job, search algorithm in c, search algorithm example

Tentang Majikan:
( 1 ulasan ) New Delhi, India

ID Projek: #370327

4 pekerja bebas membida secara purata $58 untuk pekerjaan ini


Hi, it is not clear why you want to do this. But we can discus it on PMB and get fair price.

$30 USD dalam 4 hari
(5 Ulasan)

It's impossible to compress 8000 bytes to 80 (100 times!) and then decompress it. But I sure, we can find ways to solve your problem. Please, give more details

$50 USD dalam 3 hari
(1 Ulasan)

Please check my PMB. Thanks.

$100 USD dalam sehari
(0 Ulasan)

will be done with the best possible solution. Let me know mpre about thr project, ready to start work immediately.

$50 USD dalam 3 hari
(0 Ulasan)