What should I do if I delete an empty folder in php7?

零下一度
Release: 2023-03-10 15:44:01
Original
1696 people have browsed it

This article mainly introduces the method ofdeletingempty folders in php7 based onrecursion, and analyzes php7 recursiondirectory traversaland judgment based on specific examples. For deletion and other related operation skills, friends in need can refer to

This article describes the method of deleting empty folders based on recursion in php7. Share it with everyone for your reference, the details are as follows:

php version 7.0.4

The code is as follows:


##

 $file) { if ( $file == '.' || $file == '..') { unset($files[$key]); } } if ($files) { foreach($files as $file) { if (is_dir($path . '/' . $file)) { //echo 'dir=' . $path . '/' . $file . PHP_EOL; rmDir_1($path . '/' . $file); } } } else { //echo 'rmdir=' . $path . PHP_EOL; rmdir($path); } } ?>
Copy after login

The above is the detailed content of What should I do if I delete an empty folder in php7?. For more information, please follow other related articles on the PHP Chinese website!

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
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!