mardi 24 février 2015

Why a chain have the same size applying gzcompress and gzuncompress?

i have a mysql table with a field and i don't have the permission to modify the table schema.



content varchar (255) not null


is there anyway to insert string with more size(greater than 255) to this field.i dont care how its stored(compressed or encoded).i want to retrieve the uncompressed one if it is compressed.


things i tried



gzcompress();

base64_encode();

<?php
$compressed = gzcompress('asdasdwq3eryt238774284873246827364872687342873rweuydfgjshdbfdgfgs', 9);
$uncompressed = gzuncompress($compressed);
echo $compressed.'---'.strlen($compressed);
echo "<br />";
echo $uncompressed.'----'.strlen($uncompressed);

//BOTH ARE SAME IN SIZE
?>

Aucun commentaire:

Enregistrer un commentaire