简体   繁体   English

如何在不首先使用 php 提取其内容的情况下显示 Zip 文件的图像内容?

[英]how to display image content of a Zip file without extracting its content first with php?

I tried this but not work我试过这个但没有用

<?php
  $za = new ZipArchive();

  $za->open('zip1.zip');

  for ($i=0; $i < $za->numFiles ; $i++) { 
    $stat = $za->statIndex($i);
    print_r("<img src=" .basename($stat['name']) . PHP_EOL . "/>");
  }
?>

Take a look on the function zip_entry_read()看看函数zip_entry_read()

An example how to use it you can find here您可以在此处找到如何使用它的示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM