文章目录[隐藏]
请问各位大师,我在使用php的copy()拷备文件
<?php
$file = ‘d:/temp/example.txt’ ;
$newfile = ‘e:/example.txt’ ;
if (! copy ( $file , $newfile )) {
echo “failed to copy $file …\n” ;
}
?>
拷备后的文件的时间为完成拷备的时间,而我希望拷备后的文件时间与原文件一样,不知如何处理。 9来源gaodai#ma#com搞@代~码$网搞gaodaima代码
请大师们指点。
回复讨论(解决方案)
touch($newfile, filectime($file));