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.
Â
⇒Working with Directoris and Files in PHP
⇒⇒PHP Tutorials
2016-11-20, 1156👍, 0💬
Popular Posts:
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...
Can You Specify the "new line" Character in Single-Quoted Strings? You can not specify the "new line...
How to send an FTP request with the urllib.request.urlopen() function? If an FTP server supports ano...
What properties and functions are supported on http.client.HTTPResponse objects? If you get an http....
How To Submit Values without Using a Form in PHP? If you know the values you want to submit, you can...