PHP ftp_chdir() 함수
예시
디렉터리를 변경한 다음 디렉터리 이름을 출력합니다.
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// change the current directory to php
ftp_chdir($ftp_conn, "php");
// output current directory name (/php)
echo ftp_pwd($ftp_conn);
// close connection
ftp_close($ftp_conn);
?>
정의 및 사용
ftp_chdir() 함수는 FTP 서버의 현재 디렉토리를 변경합니다.
통사론
ftp_chdir(ftp_conn, directory);
매개변수 값
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
directory | Required. Specifies the directory to change to |
기술적 세부 사항
반환 값: | 성공하면 TRUE, 실패하면 FALSE |
---|---|
PHP 버전: | 4+ |
❮ PHP FTP 참조