I am interested in cutting text from a JSON object on the server before transferring it to my mobile device that requested the object. A small tipping zipping test will reduce its size by about 80%! This is great for mobile! :)
I donβt need to save the zip file that I create on the server at all, just stay in memory and then repeat it. I can unzip it on the android side without problems.
In any case, I did a little manipulation, but I could not come up with anything that works, here is what I still have:
while($e=mysql_fetch_assoc($q)) $output[]=$e; $zip = new ZipArchive(); $zip->addFromString("test",(json_encode($output))); echo $zip;
I know that I'm probably doing something massively wrong, I'm not very familiar with php. My $ q is a cursor containing many sql rows, and if I use print(json_encode($output)); instead of all zip-shenanigans, it works great for outputting raw text.
I suppose this should not be a ZIP compression, but any compression would be helpful if you could point me in the right direction, I could probably figure it out. Thanks!
source share