Ok.. I found something to work with:
if($fp = fsockopen ("xxx.xxx.xxx.xxx", 21, $errno, $errstr, 10)){
echo "FTP server in online";
}else{
echo "FTP server is offline";
}
$fp = null; //Don't use fclose() here. If the connection was refused it will throw an error
🙂 PHP Manual, ofcourse 😃