According to the comment in PHP manual about Copy(): http://php.net/manual/en/function.copy.php
The copy() will change the last modified date of the destination file.
Is there a way that a file can be copied without updating the last modified date??
function copydt($pathSource, $pathDest) { // copy(), same modification-time
copy($pathSource, $pathDest) or return FALSE;
$dt = filemtime($pathSource);
if ($dt === FALSE) return FALSE;
return touch($pathDest, $dt);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With