php를 이용한 zip 압축 파일 생성
http://kr2.php.net/manual/en/function.ziparchive-open.php
ZipArchive::open
(PHP 5 >= 5.2.0, PECL zip >= 1.1.0)
ZipArchive::open — Open a ZIP file archive
<?php
$file = 'test.zip'; // 저장할 파일명
$zip = new ZipArchive;
$req = $zip->open($file, ZipArchive::CREATE);
if ($req === true) {
// 파일을 만들면서 내용을 넣는다.
$zip->addFromString('test.txt', 'Hear write your contents!');
$zip->close();
echo "ok ";
}
else {
echo "failed errno: ". $req ." ";
}
unset($zip);
'Programming > PHP' 카테고리의 다른 글
표준 시간대별 시간 계산 (0) | 2012.10.08 |
---|