PHP How to view directory information PHP custom functions copy and delete directory files

Source: Internet
Author: User
PHP How to view directory size and other information, PHP How to copy directories and delete files, PHP recursively delete directories and subdirectories of the custom function code, you can recursively query the directory file size, so as to count the directory size.

First, PHP directory functions

Recursively queries the file size in the directory to count the directory size.

Copy Codecode example: Second, PHP directory function with two parametersThis function needs to pass two URLs, namely the old directory and the new directory, to copy the directory and the file

Example:

Copy Codecode example: Three, PHP directory function three with one parameter

This function simply passes a URL, it can delete the directory and subdirectories of the file recursively, thus deleting the directory.

Example:

Copy Codecode example:
  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.