Heim  >  Artikel  >  Backend-Entwicklung  >  苹果ios7怎么关闭后台程序 php在线打包程序源码

苹果ios7怎么关闭后台程序 php在线打包程序源码

WBOY
WBOYOriginal
2016-07-29 08:38:28991Durchsuche

实现打包功能~轻松方便!压缩比虽比winrar差那么一点 但是也没啥关系 毕竟只打包做下载
省下了自己去服务器上把站点打包 如果服务器不是自己的就更麻烦了 要让别人帮忙打下包

复制代码 代码如下:


//php压缩目录成zip包    
//作者:小锋      
$button=$_POST['button'];    
if($button=="开始打包")    
{    
    $zip = new ZipArchive();    
    $filename = "./".date("Y-m-d")."_".md5(time())."_jackfeng.zip";    
    if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {    
        exit("无法创建 \n");    
        }    
    $files = listdir();    
    foreach($files as $path)    
    {    
        $zip->addFile($path,str_replace("./","",str_replace("\\","/",$path)));   
    }   
    echo "压缩完成,共压缩了: " . $zip->numFiles . "个文件\n";   
    $zip->close();   
}   
Function listdir($start_dir='.') {   
  $files = array();   
  if (is_dir($start_dir)) {   
   $fh = opendir($start_dir);   
   while (($file = readdir($fh)) !== false) {   
     if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue;   
     $filepath = $start_dir . '/' . $file;   
     if ( is_dir($filepath) )   
       $files = array_merge($files, listdir($filepath));   
     else   
       array_push($files, $filepath);   
   }   
   closedir($fh);   
  } else {   
   $files = false;   
  }   
 return $files;   
}   
?>   
nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >    
    
    

    
        在线打包工具    
           
       
       
        
   
            
   
            

在线打包工具

   
            

 

    
            

说明:点开始打包,之后,就是耐心等待打包完成了,根据网站文件多少,需要的时间可能会很长。打包完成之后,压缩包会存放在要打包的站点目录下,以打包时间+不定长随机字符串+jackfeng.zip这样命名,请登陆ftp后下载。

    
        
    
        

以上就介绍了苹果ios7怎么关闭后台程序 php在线打包程序源码,包括了苹果ios7怎么关闭后台程序方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn