Does anyone know how to find out if a file retrieved from FTP via PHP is a directory like the is_dir function for working with local files?
What I am doing is listing files on an ftp server remotely, and I can list the files, but want to know how I can identify any of the listed files as a directory, so I can have the user click on the directory and list it's contents.
I tried this but to no avail:
foreach ($contents as $entry) {
if (is_dir($entry)) {
echo "Directory";
}
echo $entry, "<br />\n";
}
Thanks in advance!