댓글 검색 목록

[php] zip으로 압축된 화일 풀기

페이지 정보

작성자 운영자 작성일 15-05-18 21:41 조회 2,256 댓글 0

<?php

function unZip($urllocation,$newurlLocation){

if(exec("unzip $urllocation",$arr)){

mkdir($newurlLocation);

for($i = 1;$i< count($arr);$i ){

$file = trim(preg_replace("~inflating: ~","",$arr[$i]));

copy($urllocation.'/'.$file,$newurlLocation.'/'.$file);

unlink($urllocation.'/'.$file);

}

return TRUE;

}else{

return FALSE;

}

}

if(unzip('zipfile/test.zip','unziped/myNewZip'))

echo 'Unzipped!';

else

echo 'Failed';

?> 

댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.