This will work - :)
$conn = ftp_ssl_connect(IMG_FTP_HOST);
if(!$conn)
{
exit("Can not connect to server: ".IMG_FTP_HOST."\n");
}
if(!ftp_login($conn,IMG_FTP_USERNAME,IMG_FTP_PASSWORD))
{
ftp_quit($conn);
exit("Can't login\n");
}
ftp_set_option($conn, FTP_USEPASVADDRESS, false); // set ftp option
ftp_pasv($conn, true); //make connection to passive mode
ftp_chdir($conn,$DIR);
$files = ftp_nlist($conn, '.');