摘要: function Zip($source,$destination){ if (!extension_loaded('zip') || !file_exists($source)) { return false; } $zip = new ZipArchive(); if (!$zip->open($destination, ZIPARCHIVE::OVERWRITE)) { return false; } $source = str_replace('\\'... 阅读全文
posted @ 2013-02-21 16:13 emmac 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1. 第一种方法在php manual评论中的第一个就有。public static function delTree($dir) { if(!is_dir($dir)) return; $files = array_diff(scandir($dir), array('.','..')); foreach ($files as $file) { (is_dir("$dir/$file")) ? self::delTree("$dir/$file") : unlink("$dir/$file"); }. 阅读全文
posted @ 2013-02-21 16:10 emmac 阅读(266) 评论(0) 推荐(0) 编辑