file_get_contens发送post请求
$postdata = http_build_query(
array(
'var1' => 'some content',
'var2' => 'doh'
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://example.com/submit.php', false, $context);
看到这里你可以会问那既然file_get_content可以做那么多事情还使用cur干什么?
https://www.cnblogs.com/lis2/p/16067882.html