note 98167 deleted from function.rmdir by visualmind

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: anderseta at gmail dot com 

----

function Delete_Dir($dir_p)
    {
        $dir = dir($dir_p);

        while($dir_data = $dir->read())
        {
            if ($dir_data != "." && $dir_data != "..")
            {
                if(is_dir($dir_p.$dir_data."/") == true)
                {
                    $this->Delete_Dir($dir_p.$dir_data."/");
                }
                else
                {
                    unlink($dir_p.$dir_data);
                }
            }
        }

        $dir->close();

        rmdir($dir_p);
    }

Recursive dir removal function..
(It will delete the whole directory)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.