Hello,

I need to compress a string within a PHP script (e.g. with gzip):


$my_string = "Sample string";
$my_compressed_string = str_compress($my_string);

Is this possible, and how?

Thanks,

    humm. i would think that the miniscule benefit you'd get from compressing just a string probably wouldn't be worth the processing time (or thinking time) involved.

    why is it you want to do it?

      I already found a solution: gzcompress().

        Write a Reply...