废话不多说。 $url = parse_url($url);
$url['scheme'] || $url['scheme'] = 'http'; $url['host'] || $url['host'] = $_SERVER['HTTP_HOST'];
$url['path'][0] != '/' && $url['path'] = '/'.$url['path '];
$line = fgets($fp,1024);
$results = "";
while(!feof($fp)) {
$line = fgets($fp,1024);
if ($inheader && ($line == "/n" || $line == "/r/n")) {
$inheader = 0;
}elseif (!$inheader) {
}
}fclose($fp);
return $results;
} $re = sock_post('http://localhost/direct_post/get_post.php?id=1',array('wel'=>'hello'));
echo $re;
?>
get_post.php:
代码如下:
echo "post:";