Index user-defined functions-php Tutorial

Source: Internet
Author: User
The Directory user-defined function PHP does not provide functions for querying the directory size, copying directories, and deleting directories with files. you only need to write this function by passing a url, you can recursively query the file size in the directory to calculate the directory size 1 & lt ;? Php2functiondirSize ($ dir) {3 $ dirsize0; 4 $ urlopendir ($ d Directory user-defined function

PHP does not provide functions for querying the directory size, copying directories, and deleting directories with files. we need to compile the function by ourselves.

This function can recursively query the file size in the directory by passing a url to calculate the directory size.

1
 

This function requires two URLs, the old directory and the new directory, to copy the directory and file.

1
  

This function can recursively delete files in directories and subdirectories by passing a url to delete directories.

1
   

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.