Home  >  Article  >  php教程  >  PHP多重判断删除文件函数

PHP多重判断删除文件函数

WBOY
WBOYOriginal
2016-06-13 10:59:24865browse

函数描述及例子 PHP多重判断删除文件函数 查询关键字 PHP多重判断删除文件函数

<!--?
function delete_file($file) 
{ 
    if (file_exists($file)) 
    { 
        $delete = chmod ($file, 0777); 
        $delete = unlink($file); 
        if(file_exists($file)) 
        { 
            $filesys = eregi_replace("/","\\",$file); 
            $delete = system("del $filesys"); 
            clearstatcache(); 
            if(file_exists($file)) 
            { 
                $delete = chmod ($file, 0777); 
                $delete = unlink($file); 
                $delete = system("del $filesys"); 
            } 
        } 
        clearstatcache(); 
        if(file_exists($file)) 
        { 
            return &#39;Delete Faile         :        <font color=\&#39;#ff0000\&#39;-->&#39;.$file.&#39;
&#39;; 
        } 
        else 
        { 
            return &#39;Delete Successs        :        &#39;.$file.&#39;
&#39;; 
        } 
    } 
    else 
    { 
        return &#39;Delete Successs        :        &#39;.$file.&#39;
&#39;; 
    } 
}
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn