For
PHP rmdir() function code:
- < ?php
- function removeDir($dirName)
- {
- $result = false;
- if(! is_dir($dirName))
- {
- trigger_error("Directory Name error", E_USER_ERROR);
- }
- $handle = opendir($dirName);
- while(($file = readdir($handle)) !== false)
- {
- if($file != '.' && $file != '..')
- {
- $dir = $dirName . DIRECTORY_SEPARATOR . $file;
- is_dir($dir) ? removeDir($dir) : unlink($dir);
- }
- }
- closedir($handle);
- $result = rmdir($dirName) ? true : false;
- return $result;
- }
- ?>
and above This code is the specific use of the PHP rmdir() function.
http://www.bkjia.com/PHPjc/446116.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446116.htmlTechArticleFor PHP rmdir() function code: ?php functionremoveDir($dirName) { $ result = false ; if(! is_dir($dirName)) { trigger_error(wrong directory name, E_USER_ERROR); } $ handle = opendir...
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