You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
482 B

  1. <?php
  2. $fp = fopen('zip://' . dirname(__FILE__) . '/test.zip#test', 'r');
  3. if (!$fp) {
  4. exit("cannot open\n");
  5. }
  6. while (!feof($fp)) {
  7. $contents .= fread($fp, 2);
  8. echo "$contents\n";
  9. }
  10. fclose($fp);
  11. echo "done.\n";
  12. $content = '';
  13. $z = new ZipArchive();
  14. $z->open(dirname(__FILE__) . '/test.zip');
  15. $fp = $z->getStream('test');
  16. var_dump($fp);
  17. if(!$fp) exit("\n");
  18. while (!feof($fp)) {
  19. $contents .= fread($fp, 2);
  20. }
  21. fclose($fp);
  22. file_put_contents('t',$contents);
  23. echo "done.\n";