Hey guys,
I'm trying to show a few ips are online or not, but the return is always as online. The function I'm trying to use is the one below:
<?php
function ping($host) {
$conectado = fsockopen($host, 80, $numeroDoErro, $stringDoErro, 255);
if ($conectado) {
return true;
}else{
return false;
fclose($conectado);
}
}
?>
The variable $host receives an ip like this: 172.16.10.50
I'm calling the function like this: $ping = ping($dados[ip]);
I need some extra configuration to work properly?