PHP zip_entry_read() 函数
PHP 教程
· 2019-01-30 23:43:48
定义和用法
zip_entry_read() 函数从打开的 zip 档案中获取内容。
如果成功,该函数则返回项目的内容。如果失败,则返回 FALSE。
语法
zip_entry_read(zip_entry,length)
| 参数 | 描述 |
|---|---|
| zip_entry | 必需。规定要读取的 zip 项目资源(由 zip_read() 打开的 zip 项目)。 |
| length | 可选。规定返回的字节数(未压缩尺寸)。默认是 1024。 |
实例
<?php
$zip = zip_open("test.zip");
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "<p>";
echo "Name: " . zip_entry_name($zip_entry) . "<br />";
if (zip_entry_open($zip, $zip_entry))
{
echo "File Contents:<br/>";
$contents = zip_entry_read($zip_entry);
echo "$contents<br />";
zip_entry_close($zip_entry);
}
echo "</p>";
}
zip_close($zip);
}
?>
代码的输出取决于 zip 档案的内容:
Name: ziptest.txt File Contents: Hello World! This is a test for a the zip functions in PHP. Name: htmlziptest.html File Contents: Hello World! This is a test for a the zip functions in PHP.
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
维多利亚时代的互联网
[英] 汤姆·斯丹迪奇 / 多绥婷 / 后浪丨江西人民出版社 / 2017-8 / 38.00元
人类历史上的第一次大连接 回顾互联网的前世 预言互联网的未来 ……………… ※编辑推荐※ ☆《财富》杂志推荐的75本商务人士必读书之一 ☆ 回顾互联网的前世,颠覆你的思维,升级你对互联网的认知 ☆ 人类历史上一次全球大连接是维多利亚时期的电报时代,那时候也有疯狂的资本、 巨大的泡沫、网络新型犯罪、网络亚文化崛起……现在的互联网时代就是电报时代的重演;回顾那......一起来看看 《维多利亚时代的互联网》 这本书的介绍吧!