سلام
function CheckPort($IP,$Port) {
$cfgServer = "nnn.nnn.nnn.nnn"; //IP of your router
$cfgPort = 23; //port, 22 if SSH
$cfgTimeOut = 10;
$cfgServer = $IP;
$cfgPort = $Port;
$usenet = fsockopen($cfgServer, $cfgPort, $errno, $errstr, $cfgTimeOut);
if(!$usenet){
$Status = 'Disconnected';
}
else{
$Status ='Connected';
}
return $Status;
}