<?php
function is_gd( $url )
{
$host= 'is.gd'; # hostname
$get= 'create.php?format=simple'; # get basico
$get .= '&url='. $url; # concatenamos la url
$puerto= 80; # puerto a consultar
# trama HTTP
$http_request= "GET /$get HTTP/1.1\r\n";
$http_request .= "Host: $host \r\n";
$http_request .= "Connection: close\r\n";
$http_request .= "\r\n";
# consultamos
if( ($fd= @fsockopen($host, $puerto, $errno, $errstr, 10 ))==FALSE ) # abrimos socket return 0; # error, no se abrio el socket
fwrite($fd, $http_request); # enviamos datos $buf=''; # buffer de recepcion
while( !feof($fd) ) # leeremos sockets hasta que termine $buf .= fgets($fd, 2048); # leemos
echo $result[0];
}
is_gd('http://lab.sie-group.net/');
?>
Salida: