Home > Backend Development > PHP Tutorial > A brief analysis of how to move files or folders in PHP

A brief analysis of how to move files or folders in PHP

WBOY
Release: 2016-07-25 08:52:20
Original
1026 people have browsed it
  1. rename("D:/logs/write/theme/history","F:/logs/write/theme/history");
  2. ?>
Copy code

Test analysis: For a 40M file, the copy+unlink method takes 7.6249899864197 seconds; The rename method only requires 0.024738788604736, which is 300 times faster.

Recommendation: Use the copy+unlink method with caution, and use the rename method to move files and folders.



source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template