Note that is_dir() also works with ftp://.
For example :
<?php
if(is_dir('ftp://user:pass@host/www/path/to/your/folder')) {
// Your code.
}
?>
But note that if the connexion fails due to invalide credentials, this will consider that the folder doesn't exist and will return FALSE.