kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

php 创建zip压缩文件

https://www.php.cn/faq/415187.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
	$zip = new ZipArchive;
	$zipname = $path . '/' . $uploadid . date('__Ymd_His') . '.zip';
	if ($zip->open($zipname, ZipArchive::CREATE) === false) {
		die('zip 压缩失败');
	}


	$fname = "f.docx";
	$filename = "{$path}/{$fname}";

	$zip->addFile($filename, $fname);

	$zip->addFromString('ff/f.txt', '要添加到new.txt文件中的文本');

	$zip->close();

language, php

« php 农历与公历互转 PHP image转换为base64 »