标签:php file_get_contents post http
function http_post($url,$data = null)
{
$cxContext = NULL;
if($data!=null)
{
$opts = array(
‘http‘=>array(
‘method‘=>"POST",
‘header‘=>"Content-type: application/x-www-form-urlencoded\r\n".
"Content-length:".strlen($data)."\r\n" .
"\r\n",
‘content‘ => $data,
)
);
$cxContext = stream_context_create($opts);
}
$output = file_get_contents($url, false, $cxContext);
return $output;
}
本文出自 “流媒体服务器技术研究” 博客,请务必保留此出处http://livestreaming.blog.51cto.com/3135568/1760842
PHP使用file_get_contents函数POST数据
标签:php file_get_contents post http
原文地址:http://livestreaming.blog.51cto.com/3135568/1760842