file_get_contents会做你想要的
$output = file_get_contents('http://www.example.com/');echo $output;编辑:一种触发GET请求并立即返回的方法。
引用自http://petewarden.typepad.com/searchbrowser/2008/06/how-to-post-
an.html
function curl_post_async($url, $params){ foreach ($params as $key => &$val) { if (is_array($val)) $val = implode(',', $val); $post_params[] = $key.'='.urlenpre($val); } $post_string = implode('&', $post_params); $parts=parse_url($url); $fp = fsockopen($parts['host'], isset($parts['port'])?$parts['port']:80, $errno, $errstr, 30); $out = "POST ".$parts['path']." HTTP/1.1rn"; $out.= "Host: ".$parts['host']."rn"; $out.= "Content-Type: application/x-www-form-urlenpredrn"; $out.= "Content-Length: ".strlen($post_string)."rn"; $out.= "Connection: Closernrn"; if (isset($post_string)) $out.= $post_string; fwrite($fp, $out); fclose($fp);}这是打开一个套接字,触发一个get请求,然后立即关闭该套接字并返回。



