Well, once you ftp into the directory, just use [man]ftp_nlist/man to get a list of files, and sub-directories, in the directory. Then, if you know the URL to that folder, it's just a matter of:
$list = ftp_nlist($ftp, $dir);
foreach($list as $file)
{
if(!is_dir($file) && !is_dir($dir.'/'.$list))
echo '<a href="http://www.domain.com/', $dir, '/', $file, '">', $file, '</a>';
}
That's a very basic example. You'd have to tweak it as necessary.
EDIT:
It's also possible to use [man]ftp_rawlist/man to get detailed information about the file(s) and then using the [man]substr/man function you can easily tell if it's a directory or not.