ftp_nlist()

It returns a list of files in the given directory

Example

<?php

$ftpId = ftp_connect(‘ftp.phpcodez.com’);

$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);

$data = ftp_nlist($ftpId, “.”);

ftp_close($ftpId);

?>