The fsockopen function is working fine.
http://byrondallas.heliohost.org/php/101/fsocket.php
<?php
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
if ($fp == false) {
echo "$errstr ($errno)";
} else {
fputs($fp, "GET / HTTP/1.1\r\n");
fputs($fp, "Host: www.google.com\r\n");
fputs($fp, "Connection: Close\r\n\r\n");
while (!feof($fp)) {
echo fgets($fp, 1024);
}
fclose($fp);
}
?>