error_reporting(0); $IP = array( "Login: " => "78.61.56.28:2106", " Game: " => "78.61.56.28:7777", ); while(list($ServerName,$Host)=each($IP)) { list($IPAddress,$Port)=explode(":",$Host); echo($ServerName); if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) { echo("Online"); fclose($fp); } else { echo ("Offline"); } }