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에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5186 | PHP |
swallow
|
2년 전 | 940 | |
| 5185 | PHP |
swallow
|
2년 전 | 960 | |
| 5184 | PHP |
swallow
|
2년 전 | 535 | |
| 5183 | PHP |
swallow
|
2년 전 | 834 | |
| 5182 | PHP |
swallow
|
2년 전 | 773 | |
| 5181 | 기타 |
swallow
|
2년 전 | 1016 | |
| 5180 | 2년 전 | 569 | |||
| 5179 | 기타 |
swallow
|
2년 전 | 1426 | |
| 5178 | PHP |
swallow
|
2년 전 | 791 | |
| 5177 | JavaScript |
swallow
|
2년 전 | 1484 | |
| 5176 | PHP |
swallow
|
2년 전 | 1181 | |
| 5175 | 2년 전 | 564 | |||
| 5174 | 기타 | 2년 전 | 809 | ||
| 5173 | PHP |
|
2년 전 | 962 | |
| 5172 | PHP |
|
2년 전 | 1251 | |
| 5171 | 기타 |
그누GPT
|
2년 전 | 1552 | |
| 5170 | PHP |
|
2년 전 | 1044 | |
| 5169 | PHP |
|
2년 전 | 1222 | |
| 5168 | PHP |
|
2년 전 | 1191 | |
| 5167 | JavaScript |
|
2년 전 | 993 | |
| 5166 | MySQL | 2년 전 | 1182 | ||
| 5165 | MySQL | 2년 전 | 1248 | ||
| 5164 | PHP | 2년 전 | 1498 | ||
| 5163 | OS |
|
2년 전 | 838 | |
| 5162 | 웹서버 |
|
2년 전 | 887 | |
| 5161 | 웹서버 |
|
2년 전 | 970 | |
| 5160 | PHP |
|
2년 전 | 840 | |
| 5159 | PHP |
|
2년 전 | 901 | |
| 5158 | PHP |
|
2년 전 | 907 | |
| 5157 | PHP |
|
2년 전 | 938 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기