$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $hosturl); //发贴地址
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST,false); //设置POST方式
curl_setopt($ch, CURLOPT_HEADER, 1);
$output = curl_exec($ch);
if($output === false)
{
echo 'Curl error: ' . curl_error($ch);
}