- stream_set_blocking: documentation ( source)
- fsockopen: documentation ( source)
- fclose: documentation ( source)
- fwrite: documentation ( source)
<?php
$fp = fsockopen("www.baidu.com", 80, $errno, $errstr, 30);
if (!$fp) die('error fsockopen');
stream_set_blocking($fp,0);
$http = "GET /index.php / HTTP/1.1\r\n";
$http .= "Host: www.baidu.com\r\n";
$http .= "Connection: Close\r\n\r\n";
fwrite($fp,$http);
fclose($fp);
?>