PHP function to delete directory_PHP tutorial

WBOY
Release: 2016-07-20 11:00:40
Original
1050 people have browsed it

php function to delete directory ​

Example application to delete a file directory:
function scmulu($mlming)
{
$dkml = opendir($mlming);
readdir($dkml);
readdir($dkml);
while(($wj = readdir($dkml))!==false)
{
$wj = $mlming.DIRECTORY_SEPARATOR.$wj;
if(is_dir($wj))
{
scmulu($wj);
}else
{
if(unlink($wj))
{
echo "File$wj was deleted successfully
";
}else
{
echo "File$wjfailed to delete
";
}
}
}
closedir($dkml);
if(rmdir($mlming))
{
echo "Directory$mlming was deleted successfully
";
}else
{
echo "Directory$mlmingfailed to delete
";
}
}


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445501.htmlTechArticlephp function example of deleting a directory is used to delete a directory with files: function scmulu($mlming) { $dkml = opendir($mlming); readdir($dkml); readdir($dkml); while(($wj = readdir($...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!