Copying a File in PHP


Duplicate a file using copy(), providing a source and a destination.

Source Code

if (copy('source.txt', 'destination.txt')) {
    echo "File copied successfully.";
} else {
    echo "File copy failed.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments