컴

ftp_rename - FTP 서버의 파일 또는 디렉토리 이름 바꾸기

· 2017-02-24 (금) 00:34:04 · 3668

ftp_rename - FTP 서버의 파일 또는 디렉토리 이름 바꾸기

 

설명 ¶

 

bool ftp_rename ( resource $ftp_stream , string $oldname , string $newname )

ftp_rename () 은 FTP 서버의 파일이나 디렉토리의 이름을 바꿉니다.

 

매개 변수 ¶

 

ftp_stream

FTP 연결의 링크 식별자입니다.

 

oldname

이전 파일 / 디렉토리 이름.

 

newname

새로운 이름.

 

반환 값 ¶

 

반환 값 TRUE성공 또는 FALSE실패. 실패하면 (예 : 존재하지 않는 파일의 이름을 바꾸려고 시도하는 경우) E_WARNING 오류가 발생합니다.

 

예 ¶

 

Example # 1 ftp_rename () 예제

 

<?php

$old_file = 'somefile.txt.bak';

$new_file = 'somefile.txt';

 

// set up basic connection

$conn_id = ftp_connect($ftp_server);

 

// login with username and password

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

 

// try to rename $old_file to $new_file

if (ftp_rename($conn_id, $old_file, $new_file)) {

 echo "successfully renamed $old_file to $new_file\n";

} else {

 echo "There was a problem while renaming $old_file to $new_file\n";

}

 

// close the connection

ftp_close($conn_id);

?>

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
PHP 17-03-09 조회 2,808
PHP 17-03-09 조회 2,689
PHP 17-03-09 조회 2,898
jQuery 17-03-09 조회 2,339
jQuery 17-03-09 조회 2,216
jQuery 17-03-09 조회 2,162
PHP 17-03-08 조회 2,171
PHP 17-03-08 조회 2,344
PHP 17-03-08 조회 2,320
jQuery 17-03-08 조회 2,839
jQuery 17-03-08 조회 2,648
jQuery 17-03-08 조회 2,785
기타 17-03-08 조회 1.7만
기타 17-03-06 조회 2,615
PHP 17-03-01 조회 3,048
PHP 17-03-01 조회 3,567
PHP 17-03-01 조회 2,498
PHP 17-02-28 조회 2,173
PHP 17-02-28 조회 2,374
PHP 17-02-28 조회 2,570
PHP 17-02-27 조회 2,803
PHP 17-02-27 조회 2,661
PHP 17-02-27 조회 3,261
PHP 17-02-26 조회 2,603
PHP 17-02-26 조회 2,498
PHP 17-02-26 조회 2,899
PHP 17-02-25 조회 2,620
PHP 17-02-25 조회 2,657
PHP 17-02-25 조회 2,551
PHP 17-02-24 조회 3,024