PHP多重判断删除文件函数 - TOMMYHU - 专注互联网开发及运营技术,提供相关资料及软件下载,奇趣网络时事评论!
Jun 9

PHP多重判断删除文件函数 不指定

tommyhu , 14:51 , PHP , Comments(0) , Trackbacks(0) , Reads(7649) , Via Original Large | Medium | Small

PHP多重判断删除文件函数



<?
function delete_file($file)
{
    if (file_exists($file))
    {
        $delete = chmod ($file, 0777);
      &amp;nbs[separator]p; $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 'Delete Faile         :        <font color=\'#ff0000\'>'.$file.'</font><br>';
        }
        else
        {
            return 'Delete Successs        :        <font color=\'#6699cc\'>'.$file.'</font><br>';
        }
    }
    else
    {
        return 'Delete Successs        :        <font color=\'#6699cc\'>'.$file.'</font><br>';
    }
}
?>


函数描述及例子



PHP多重判断删除文件函数




▲返回顶部
Last modified by tommyhu on2009/06/09 15:07

Add a comment

Nickname

emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot