$info[] = array('name' => 'SERVER', 'address' => 'IP', 'port' => 'PORT'); $ic = sizeof($info); $timeout = 0; while($ic--) echo (fsockopen($info[$ic]['address'], $info[$ic]['port'], $errno, $errstr, $timeout))? 'SERVER ONLINE' : 'SERVER OFFLINE';