Turn on full php error reporting to see if any errors are occurring.
For your code to work, two things must happen. PHP must have the OpenSSL extension enabled so that it can make a request using the ftps protocol, and the ftps wrapper must support scandir().
From the php manual it is not clear if scandir() is supported. Table O.4 does not specifically list scandir(), but it would probably fall under the stat() functions, where only the following are supported - As of PHP 5.0.0: filesize(), filetype(), file_exists(), is_file(), and is_dir() elements only. As of PHP 5.1.0: filemtime().
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.