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, 1259👍, 0💬
Popular Posts:
dev.FYIcenter.com is a Website for software developer looking for software development technologies,...
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...
How To Merge Cells in a Column? If you want to merge multiple cells vertically in a row, you need to...
What Is session_register() in PHP? session_register() is old function that registers global variable...
What Are Python Built-in Primitive Data Types? Python Built-in Primitive Data Types are data types p...