zoukankan      html  css  js  c++  java
  • PHP删除临时文件

    /**
        * 下载后直接删除临时文件
        */  
        public function deldir($dir) {
            $dh=opendir($dir);
            while ($file=readdir($dh)) {
            if($file!="." && $file!="..") {
                    $fullpath=$dir."/".$file;
                    if(!is_dir($fullpath)) {
                        //$path = iconv('utf-8','gbk',$fullpath);
                        unlink($fullpath);
                    } else {
                        $this->deldir($fullpath);
                    }
                }
            }
            closedir($dh);
            if(rmdir($dir)) {
                return true;
            } else {
                return false;
            }
        }

  • 相关阅读:
    ubuntu下使用golang、qml与ubuntu sdk开发桌面应用 (简单示例)
    Go Revel 学习指南
    Go Revel
    Go Revel
    Go Revel
    Go Revel
    Go Revel
    Go Revel
    Go Revel
    Go Revel
  • 原文地址:https://www.cnblogs.com/wanghaodong/p/9482647.html
Copyright © 2011-2022 走看看