This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
[solved]Compress with php
Started by FuuuAInfiniteLoop(F.A.I.L), 13 February 2013 - 02:25 AMPosted 13 February 2013 - 03:25 AM
anybody know how to compress a string with php so i can use iit in a program?
Posted 13 February 2013 - 03:34 AM
Posted 13 February 2013 - 03:35 AM
I making a compress program and that would be a function
Posted 13 February 2013 - 03:38 AM
well which compression algorithm do you want?
Posted 13 February 2013 - 03:40 AM
for gz compression, you have options
if you want just the data compressed, use gzcompress
if you want actual gzip file data, use gzencode
if you want just the data compressed, use gzcompress
if you want actual gzip file data, use gzencode
Posted 13 February 2013 - 03:50 AM
and how can i pass my string to php and return the value?
i will use gzencode
i will use gzencode
Posted 13 February 2013 - 03:58 AM
you can use the $_GET table
http.request("http://somesite/derp.php?data="..textutils.urlencode(text).."&mode=compress")
then for php
if ($_GET["mode"]=="compress") {
echo compress_function($_GET["data"]);
} elseif ($_GET["mode"]=="decompress") {
echo decompress_function($_GET["data"]);
}
Posted 13 February 2013 - 04:00 AM
Just FYI, you don't have to report your post as Solved. You can use the full editor to change the title to include a [Solved] tag.