Tools, FAQ, Tutorials:
Copying a File in PHP
How To Copy a File in PHP?
✍: FYIcenter.com
If you have a file and want to make a copy to create a new file, you can use the copy() function. Here is a PHP script example on how to use copy():
<?php
unlink("/temp/myPing.exe");
copy("/windows/system32/ping.exe", "/temp/myPing.exe");
if (file_exists("/temp/myPing.exe")) {
print("A copy of ping.exe is created.\n");
}
?>
This script will print:
A copy of ping.exe is created.
⇒ Putting Directory Entries into an Array in PHP
2016-11-20, ∼2376🔥, 0💬
Popular Posts:
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...
How to Build my "sleep" Docker image from the Alpine image? I want the container to sleep for 10 hou...
Where to find tutorials on Microsoft Azure services? Here is a large collection of tutorials to answ...
Where to find EPUB Sample Files? Here is a list of EPUB sample files collected by FYIcenter.com team...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...