file.html이라는 파일이있는 경우 PHP를 통해이 파일의 복제본을 어떻게 만드나요? file1 .... file10로 바꿉니 까?PHP 대용량 파일 복사
$filename = 'file.html'
$copyname = 'file2.html'
if ($file = @fopen($copyname, 'x')) {
// We've successfully created a file, so it's ours. We'll close
// our handle.
if ([email protected]($file)) {
// There was some problem with our file handle.
return false;
}
// Now we copy over the file we created.
if ([email protected]($filename, $copyname)) {
// The copy failed, even though we own the file, so we'll clean
// up by itrying to remove the file and report failure.
unlink($copyname);
return false;
}
return true;
}
프로그램을 디버그하는 데 도움이되는 오류 메시지를 숨기는 @ 기호를 제거하십시오. – tomsv