Home >Backend Development >PHP Tutorial > 将目录下文件打包,该怎么解决

将目录下文件打包,该怎么解决

WBOY
WBOYOriginal
2016-06-13 13:42:331092browse

将目录下文件打包
我一个目录下存在以下文件:
2007051501   2007051502   2007051601   2007051602

要求将文件包含20070515的两个文件打包成20070515.tar.gz
同理,将包含20070516的两个文件打包成20070516.tar.gz

------解决方案--------------------
$command= "tar -cvf 20060515.tar.gz 20060515.* ";
exec($command);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn