Home >Backend Development >PHP Tutorial >How to view directory information in PHP PHP custom function to copy and delete directory files

How to view directory information in PHP PHP custom function to copy and delete directory files

WBOY
WBOYOriginal
2016-07-25 08:51:241264browse
How to check directory size and other information in PHP, how to copy directories and delete files in PHP, PHP's custom function code to recursively delete directories and subdirectories, and recursively query the file size in the directory to calculate the directory size.

1. PHP directory function

Recursively query the file size in the directory to calculate the directory size.

Copy code Code example: 2. PHP directory function takes two parameters This function needs to pass two URLs, namely the old directory and the new directory, so that the directory and files can be copied

Example:

Copy code Code example: 3. PHP directory function three takes one parameter

This function can recursively delete the files in the directory and subdirectories by passing a url, thereby deleting the directory.

Example:

Copy code Code example:


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