ftp_chdir - FTP 서버의 현재 디렉토리를 변경
ftp_chdir - FTP 서버의 현재 디렉토리를 변경
설명 ¶
bool ftp_chdir ( resource $ftp_stream , string $directory )
현재 디렉토리를 지정된 디렉토리로 변경합니다.
매개 변수 ¶
ftp_stream
FTP 연결의 링크 식별자입니다.
directory
대상 디렉토리.
값을 돌려줍니다 ¶
반환 값 TRUE성공 또는 FALSE실패. 디렉토리 변경이 실패하면 PHP는 경고를 발생시킵니다.
예 ¶
예 # 1 ftp_chdir () 예
<?php
// 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);
// check connection
if ((!$conn_id) || (!$login_result)) {
die("FTP connection has failed !");
}
echo "Current directory: " . ftp_pwd($conn_id) . "\n";
// try to change the directory to somedir
if (ftp_chdir($conn_id, "somedir")) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
} else {
echo "Couldn't change directory\n";
}
// close the connection
ftp_close($conn_id);
?>
설명 ¶
bool ftp_chdir ( resource $ftp_stream , string $directory )
현재 디렉토리를 지정된 디렉토리로 변경합니다.
매개 변수 ¶
ftp_stream
FTP 연결의 링크 식별자입니다.
directory
대상 디렉토리.
값을 돌려줍니다 ¶
반환 값 TRUE성공 또는 FALSE실패. 디렉토리 변경이 실패하면 PHP는 경고를 발생시킵니다.
예 ¶
예 # 1 ftp_chdir () 예
<?php
// 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);
// check connection
if ((!$conn_id) || (!$login_result)) {
die("FTP connection has failed !");
}
echo "Current directory: " . ftp_pwd($conn_id) . "\n";
// try to change the directory to somedir
if (ftp_chdir($conn_id, "somedir")) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
} else {
echo "Couldn't change directory\n";
}
// close the connection
ftp_close($conn_id);
?>
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5396 | 기타 |
슈퍼스타맨
|
4개월 전 | 352 | |
| 5395 | PHP |
untitled
|
5개월 전 | 822 | |
| 5394 | MySQL |
선택과집중
|
6개월 전 | 596 | |
| 5393 | 웹서버 |
techstar
|
8개월 전 | 863 | |
| 5392 |
|
1년 전 | 1219 | ||
| 5391 | 10개월 전 | 1119 | |||
| 5390 | 10개월 전 | 905 | |||
| 5389 | 9개월 전 | 874 | |||
| 5388 | 9개월 전 | 974 | |||
| 5387 | 8개월 전 | 807 | |||
| 5386 | JavaScript |
nekoieye
|
8개월 전 | 971 | |
| 5385 | 웹서버 | 8개월 전 | 989 | ||
| 5384 | JavaScript |
|
9개월 전 | 819 | |
| 5383 | 기타 | 10개월 전 | 1128 | ||
| 5382 | 기타 |
|
10개월 전 | 578 | |
| 5381 | JavaScript | 10개월 전 | 909 | ||
| 5380 | 기타 |
|
10개월 전 | 691 | |
| 5379 | JavaScript | 10개월 전 | 692 | ||
| 5378 | 11개월 전 | 1198 | |||
| 5377 | 기타 |
|
11개월 전 | 761 | |
| 5376 | jQuery |
|
11개월 전 | 575 | |
| 5375 | jQuery |
techstar
|
11개월 전 | 729 | |
| 5374 | 기타 |
|
11개월 전 | 780 | |
| 5373 | MySQL |
|
11개월 전 | 812 | |
| 5372 | 기타 |
|
11개월 전 | 1013 | |
| 5371 | JavaScript |
|
11개월 전 | 727 | |
| 5370 | JavaScript |
|
11개월 전 | 731 | |
| 5369 | PHP |
|
11개월 전 | 1243 | |
| 5368 | PHP | 1년 전 | 1408 | ||
| 5367 | 기타 |
nekoieye
|
1년 전 | 1284 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기