//您要请求的url
$url="http://www.xiaoshu168.com"
//请求传递的数据
$post_data=array("user"=>"test","pass"=>"123456");
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
//post数据
curl_setopt($ch,CURLOPT_POST,1);
//post的变量
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_data);
$output=curl_exec($ch);
curl_close($ch);
//打印获得的数据
print_r($output);本文由:xiaoshu168 作者:xiaoshu发表,转载请注明来源!