using gzdeflate on a string php

yes you can actually run compression on a string to save space and then uncompress it at the other end...


$string = str_repeat('1234567890' . implode('', range('a', 'z')), 48800);

echo strlen($string); //1756800 bytes

$compressed = gzdeflate($string,  9);
$compressed = gzdeflate($compressed, 9);

echo strlen($compressed); //99 bytes

echo gzinflate(gzinflate($compressed));

External Link for using gzdeflate on a string php

Other Items in php
Related Search Terms
Page Views

This page has been viewed 33 times.

Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.


Random Quote
Old programmers never die; they just lose some of their functions.