Jump to content




[solved]Compress with php


  • You cannot reply to this topic
7 replies to this topic

#1 FuuuAInfiniteLoop(F.A.I.L)

  • Banned
  • 435 posts
  • LocationThe left part of this post

Posted 13 February 2013 - 03:25 AM

anybody know how to compress a string with php so i can use iit in a program?

#2 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

Posted 13 February 2013 - 03:34 AM

why would you want to compress it?

try this

base64 is probably the fastest

#3 FuuuAInfiniteLoop(F.A.I.L)

  • Banned
  • 435 posts
  • LocationThe left part of this post

Posted 13 February 2013 - 03:35 AM

I making a compress program and that would be a function

#4 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

Posted 13 February 2013 - 03:38 AM

well which compression algorithm do you want?

#5 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

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

#6 FuuuAInfiniteLoop(F.A.I.L)

  • Banned
  • 435 posts
  • LocationThe left part of this post

Posted 13 February 2013 - 03:50 AM

and how can i pass my string to php and return the value?

i will use gzencode

#7 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

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"]);
}


#8 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users