Código PHP:
<?php
$socket=socket_create(AF_INET, ROCK_RAW, 1);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 4, 'usec' => 0));
socket_connect($socket, '74.125.157.99', null);
$package = "\x08\x00\x7d\x4b\x00\x00\x00\x00PingHost";
socket_send($socket, $package, strlen($package), 0);
if (socket_read ($socket, 255) )
{
echo 'si conecta';
} else {
echo 'no conecta';
}
?>