What potential issues or errors should be considered when copying files in PHP?

One potential issue when copying files in PHP is not checking if the destination file already exists, which can result in overwriting existing files unintentionally. To solve this, you can use the `file_exists()` function to check if the destination file already exists before copying.

$source = 'source_file.txt';
$destination = 'destination_file.txt';

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