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://codercto.com/courses/l/5.html
C语言算法速查手册
程晓旭、耿鲁静、张海、王勇 / 2009-10 / 49.00元
《C语言算法速查手册》用C语言编写了科研和工程中最常用的166个算法,这些算法包括复数运算、多项式的计算、矩阵运算、线性代数方程组的求解、非线性方程与方程组的求解、代数插值法、数值积分法、常微分方程(组)初值问题的求解、拟合与逼近、特殊函数、极值问题、随机数产生与统计描述、查找、排序、数学变换与滤波等。同时结合这些算法列举了将近100个应用实例,对其进行验证和分析。 《C语言算法速查手册》适......一起来看看 《C语言算法速查手册》 这本书的介绍吧!