Thanks to h3 at valleyfield dot netSame function with some minor changes and comments addedFTP function checks if a directory exists<?phpfunction ftp_is_dir( $dir ) { global $ftpcon; // get current directory $original_directory = ftp_pwd( $ftpcon ); // test if you can change directory to $dir // suppress errors in case $dir is not a file or not a directory if ( @ftp_chdir( $ftpcon, $dir ) ) { // If it is a directory, then change the directory back to the original directory ftp_chdir( $ftpcon, $original_directory ); return true; } else { return false; } } ?>