As we all know, the PHP rmdir () function is used to delete empty directories, but if you want to delete a non-empty directory, we must delete the files or subdirectories in the non-empty directory, this article introduces how PHP uses recursive
PHP rmdir () functionRmdir― Delete Empty DirectoryGrammar:BOOL RmDir (String $dirname [, Resource $context])An attempt was made to delete the directory specified by DirName. The directory must be empty and have the appropriate permissions. Failure
Explains how to use the PHP function rmdir. In PHP, there are many functions for programming, and their functions are also very powerful. Today we will introduce to you that PHP is a type of function embedded in HTML and server in PHP. There are
First, let's introduce the rmdir () function.
PHP rmdir () function
rmdir-Delete Empty Directory
Grammar:
BOOL RmDir (String $dirname [, Resource $context])
An attempt was made to delete the directory specified by DirName. The directory must be
PHP simple use of rmdir to remove directories, Phprmdir directory usage
This example describes the simple use of PHP to delete a directory through rmdir. Share to everyone for your reference. The specific analysis is as follows:
PHP can delete
This time for everyone to bring PHP unlink and rmdir Delete directory within the file how to implement, PHP unlink and rmdir Delete directory files in the attention of the matter, the following is the actual case, together to see.
Function code:
deleting files and directories in PHP is actually very simple as long as two functions one is unlink a rmdir function, if you want to implement delete directories and directories under the file we need to use the recursive operation.
Function code:
Usage of unlink (), mkdir (), and rmdir () in php
Unlink () function use instance
// Use the unlink function to delete an object
$ Filename = "data.txt"; // defines the variable
deleting files and directories in PHP is actually very simple as long as two functions one is unlink a rmdir function, if you want to implement delete directories and directories under the file we need to use the recursive operation. This article
Use of the unlink () and rmdir () functions for deleting files and folders in PHP. Let's take a look at the code copy code as follows :? Functiondeldir ($ dir) {delete the files in the directory first: $ dhopendir ($ dir); while ($ filereaddir ($ dh)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.