"함수 copy()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
8번째 줄: 8번째 줄:
[[분류: PHP]]
[[분류: PHP]]
{{참고|PHP copy()}}
{{참고|PHP copy()}}
<source lang='php'>
<syntaxhighlight lang='php'>
copy('example.txt', 'example.txt.bak');
copy('example.txt', 'example.txt.bak');
</source>
</syntaxhighlight>
<source lang='php'>
<syntaxhighlight lang='php'>
$file = 'example.txt';
$file = 'example.txt';
$newfile = 'example.txt.bak';
$newfile = 'example.txt.bak';
18번째 줄: 18번째 줄:
     echo "failed to copy $file...\n";
     echo "failed to copy $file...\n";
}
}
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:36 판


1 개요

함수 copy()
  • 파일을 복사하는 함수

2 PHP

copy('example.txt', 'example.txt.bak');
$file = 'example.txt';
$newfile = 'example.txt.bak';

if (!copy($file, $newfile)) {
    echo "failed to copy $file...\n";
}

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}