Discover how to delete folder in php, include the articles, news, trends, analysis and practical advice about how to delete folder in php on alibabacloud.com
PHP provides functions such as filesize, copy, unlink, and so on, but does not provide functions such as dirsize, Copydir, Rmdirs and Other folder operations (RmDir can only delete empty directories). So you can only write these functions manually,
a more comprehensive set of PHP tutorials , basic video and some small combat projects, below is the video directoryCD-ROM (i) \php employment Class (I.)CD-ROM (i) \php Technical exchange zone. URLCD-ROM (i) \ "Wisdom Special issue" belongs to it
PHP File Operations Summary (delete the specified file/Get folder under the file name/read the folder name),
This paper analyzes the methods of PHP file operation. Share to everyone for your reference, as follows:
First, delete the file
Unlink
Create the fileutil.php file with the following content and invocation methods:
Php/** * manipulating File class * * Example: * Fileutil::createdir (' A/1/2/3 '); Test build folder Build a A/1/2/3 folder * fileutil::createfile
1
2 $dir = ' directory path you want to delete '; As follows:
3//$dir = $_server[' Document_root '). ' /cache ';
4 Rmdirs ($DIR);
5
6//php Delete files in the specified directory-How do I delete a file specified under a directory in PHP?
7 function
This article mainly introduces PHP based on iterative implementation of folder copy, delete, view size and other operations, simple explanation of the principle of the iteration and combined with the example of PHP to implement the iterative
This article mainly introduces PHP based on iterative implementation of folder copy, delete, view size and other operations, simple explanation of the principle of the iteration and combined with the example of PHP to implement the iterative
This article analyzes the method of PHP file operation. Share to everyone for your reference, specific as follows:
Delete a file
Unlink ()
Syntax: int unlink (string filename);
return value: Integer
Function type: file access. Such as:
This article mainly introduces php file operations, including deleting a specified file, obtaining the file name under a folder, and reading the folder name. it involves common php operations on files and directories, for more information about php
Ask for advice. However, you cannot delete the original folder. You can only delete files. But you cannot delete the original folder. You can only delete files.
Reply content:
Ask for advice. But you cannot delete the original folder. You can only
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.