What is the function in PHP that can be used to copy files, such as images, from one location to another?

To copy files from one location to another in PHP, you can use the `copy()` function. This function takes two parameters - the source file path and the destination file path. It creates a copy of the source file at the specified destination.

$source = '/path/to/source/file.jpg';
$destination = '/path/to/destination/file.jpg';

if(copy($source, $destination)){
    echo "File copied successfully.";
} else {
    echo "Failed to copy file.";
}