Home> php教程> PHP开发> body text

PHP delete files and folders using the two functions unlink() and rmdir()

高洛峰
Release: 2016-12-28 15:00:34
Original
2356 people have browsed it

Let’s take a look at the code first

Copy after login

The unlink() function is used to delete files. Returns true if successful, false if failed. The rmdir() function is used to delete empty directories. It attempts to delete the directory specified by dir. The directory must be empty and must have appropriate permissions.
An example: Delete all ".svn" folders under a certain folder (including their contents must also be deleted).

Copy after login

For more PHP file and folder deletion operations and related articles on the use of the two functions unlink() and rmdir(), please pay attention to the PHP Chinese website!

Related labels:
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 Recommendations
    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!