给出这段代码:
<?php
$zipPath="./database.md5.zip";
$database_entry_name="database.md5.txt";
$pass="pwd";
$zip = new ZipArchive();
if ($zip->open($zipPath) === TRUE) {
$zip->setPassword($pass);
echo "$database_entry_name<br/>";
if($database_entry = $zip->getFromName($database_entry_name,10)) {
echo "Working ! Have 10 bytes: $database_entry<br/>";
}
$handle=$zip->getStream($database_entry_name);
if(!$handle){
exit("Not working.\n");
}
echo "WORKING ! First line: " . fgets($handle) . "!";
}
?>
ZipArchive::getStream()
调用失败。我是在输入错误,还是这是扩展名的限制?
我想逐行解压缩条目,直到找到相关条目为止。