本文整理汇总了PHP中Zip::get_file方法的典型用法代码示例。如果您正苦于以下问题:PHP Zip::get_file方法的具体用法?PHP Zip::get_file怎么用?PHP Zip::get_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zip
的用法示例。
在下文中一共展示了Zip::get_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_escape_string_userdefine
//print $FILE_CONTENT;
mysql_free_result($TABLE_ARRAY);
//if (!fwrite($handle, $FILE_CONTENT)) {
// break;
//}
fclose($handle);
//压缩SQL文件为ZIP文件
$key = $PureSQLFile . ".zip";
$zip = new Zip();
$zipfile = $filename;
$filesize = @filesize($zipfile);
$fp = @fopen($zipfile, rb);
$zipfiles[] = array($PureSQLFile, @fread($fp, $filesize));
@fclose($fp);
$zip->Add($zipfiles, 1);
if (@fputs(@fopen("../../databackup/" . $key, "wb"), $zip->get_file())) {
$filename = "../../databackup/" . $key;
}
table_begin("500");
print "<tr class=\"TableControl\"> <td colspan=\"12\" align=center> <a href=\"{$filename}\" title='点击右键,选择目标另存为'>数据库已经备份完成,总备份" . count($NewTableArray) . "个数据表,点击右键选择目标另存为下载数据库SQL文件</a><BR> <input type=button value=返回 class=BigButton onClick=\"location='?'\" title=返回> </td></tr>";
table_end();
}
exit;
}
function mysql_escape_string_userdefine($TEXT)
{
$TEXT = html_entity_decode($TEXT);
$TEXT = htmlspecialchars_decode($TEXT);
$TEXT = ereg_replace("'", "\\'", $TEXT);
$TEXT = ereg_replace('"', '\\"', $TEXT);
$TEXT = ereg_replace(';', '\\;', $TEXT);
示例2: array
$filename = $zipfilearray[$i];
$filesize = @filesize($dir . "/" . $zipfilearray[$i]);
$fp = @fopen($dir . "/" . $filename, rb);
$zipfiles[] = array($filename, @fread($fp, $filesize));
@fclose($fp);
}
} else {
$filename = $dl[$k];
$filesize = @filesize($zipfile);
$fp = @fopen($zipfile, rb);
$zipfiles[] = array($filename, @fread($fp, $filesize));
@fclose($fp);
}
}
$zip->Add($zipfiles, 1);
$code = $zip->get_file();
$ck = "_QQ44997_" . date("Y-m-d", time()) . "";
if (empty($localfile)) {
header("Content-type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Accept-Length: " . strlen($code));
header("Content-Disposition: attachment;filename=" . $_SERVER['HTTP_HOST'] . "" . $ck . "_Files.zip");
echo $code;
exit;
} else {
$fp = @fopen("" . $dir . "/" . $localfile . "", "w");
echo $msg = @fwrite($fp, $code) ? "压缩保存" . $dir . "/" . $localfile . "本地成功!!" : "目录" . $dir . "无可写权限!";
@fclose($fp);
}
}
} else {