How can PHP be used to copy files between directories?

To copy files between directories using PHP, you can use the `copy()` function provided by PHP. This function takes two parameters: the source file path and the destination file path. By calling `copy($source, $destination)`, you can easily copy a file from one directory to another.

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

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