GZip.php 512 B

123456789101112131415161718192021222324
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. /**
  8. * Description of GZip
  9. *
  10. * @author jgao
  11. */
  12. class GZip {
  13. //put your code here
  14. static function encode($data){
  15. return gzencode($data);
  16. }
  17. static function decode($data){
  18. return gzinflate(substr($data,10,-8)); // 高版本的php已经拥有名为【gzdecode】的api
  19. }
  20. }