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에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5306 | JavaScript |
niceguys
|
1년 전 | 1217 | |
| 5305 | JavaScript |
niceguys
|
1년 전 | 1113 | |
| 5304 | PHP |
niceguys
|
1년 전 | 742 | |
| 5303 | JavaScript |
|
1년 전 | 1305 | |
| 5302 | PHP |
|
2년 전 | 801 | |
| 5301 | JavaScript |
techstar
|
2년 전 | 610 | |
| 5300 | PHP |
techstar
|
2년 전 | 671 | |
| 5299 | jQuery | 2년 전 | 698 | ||
| 5298 | JavaScript | 2년 전 | 630 | ||
| 5297 | 기타 |
시우시우9082
|
2년 전 | 1107 | |
| 5296 | 기타 |
|
2년 전 | 795 | |
| 5295 | PHP | 2년 전 | 1131 | ||
| 5294 | JavaScript |
swallow
|
2년 전 | 1900 | |
| 5293 | JavaScript |
swallow
|
2년 전 | 816 | |
| 5292 | JavaScript |
swallow
|
2년 전 | 1003 | |
| 5291 | JavaScript |
swallow
|
2년 전 | 688 | |
| 5290 | PHP |
swallow
|
2년 전 | 797 | |
| 5289 | PHP |
swallow
|
2년 전 | 814 | |
| 5288 | JavaScript |
swallow
|
2년 전 | 829 | |
| 5287 |
swallow
|
2년 전 | 1371 | ||
| 5286 | 2년 전 | 1577 | |||
| 5285 | 2년 전 | 1301 | |||
| 5284 | 2년 전 | 1718 | |||
| 5283 | 2년 전 | 1741 | |||
| 5282 | 2년 전 | 1436 | |||
| 5281 |
|
2년 전 | 1737 | ||
| 5280 | 2년 전 | 1168 | |||
| 5279 | 2년 전 | 1805 | |||
| 5278 | JavaScript | 2년 전 | 1607 | ||
| 5277 | 2년 전 | 1402 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기