PHP의 ftp_pwd () 함수
정의 및 사용
ftp_pwd () 함수는 FTP 연결의 현재 디렉토리의 이름을 반환합니다.
문법
ftp_pwd(ftp_connection)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
예
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
// print current directory
echo ftp_pwd($conn) . "<br />";
// change directory to images
ftp_chdir($conn,"images");
// print current directory
echo ftp_pwd($conn);
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
// print current directory
echo ftp_pwd($conn) . "<br />";
// change directory to images
ftp_chdir($conn,"images");
// print current directory
echo ftp_pwd($conn);
ftp_close($conn);
?>
가 출력 위의 코드 :
/
/images
/images
PHP FTP 참조 완료