如何在PHP中解压缩最初使用zlib压缩的数据?

I am quite new to Iphone development , so please bear me if I ask some some common questions. In my application I have to transfer data from my Iphone app to a PHP server and for this I have to compress the NSdata in my Iphone app and then pass it on to the PHP server and then Uncompress it in PHP and process the data sent by Iphone in PHP.

For compressing the data in Iphone I have used zlib library.Now on PHP side I want to uncompress this data , but I am unable to do so.

Can anyone help me in uncompressing this data in PHP.

Thanks in Advance.

Gaurav Arora

Use gzuncompress function: http://ru2.php.net/manual/en/function.gzuncompress.php

Example:

<?php
$compressed   = gzcompress('Compress me', 9);
$uncompressed = gzuncompress($compressed);
echo $uncompressed;