Compressing strings
Moderator: General Moderators
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Compressing strings
I intend to have some of my gamedata as long strings and to store them in the database. I also think od compressing them while they are in the database. Whats the best way to do this? Any compression classes that result as string not file? What type of a database field i need to use? Any suggestions, pro's, con's?
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Code: Select all
<?php
$ot = "This is a test. This is only a test. This is not an important string.";
$ct = gzcompress($ot,9);
echo $ct."<BR>";
$ct = gzuncompress($ct);
echo $ct;
?>