I am using the PHP script below to test FTP connections. Currently it is printing an array of the files, if it successfully connects.
How can I get it to also display
Note that you're already dieing when you fail to connect, so you can assume that you are connected. However, you can also check the status of the connection using:
die
echo $con !== FALSE ? 'Connected' : "Couldn't connect";
ftp_connect: Returns a FTP stream on success or FALSE on error.