PHP ftp_mlsd() 함수
예시
"images" 디렉토리에서 파일 목록을 반환합니다.
<?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);
$dir = "/images";
$dirlist = ftp_mlsd($ftp_conn, $dir);
// output directory list
echo($dirlist);
// close connection
ftp_close($ftp_conn);
?>
정의 및 사용
ftp_mlsd() 함수는 지정된 디렉토리에 있는 파일 목록을 반환합니다.
통사론
ftp_mlsd(ftp_conn, dir);
매개변수 값
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
dir | Required. Specifies the name of the directory to be listed. Use "." to get the current directory |
기술적 세부 사항
반환 값: | 성공 시 지정된 디렉토리의 파일 정보가 있는 배열, 실패 시 FALSE |
---|---|
PHP 버전: | 7.2+ |
❮ PHP FTP 참조