php file_get_contents 发表于 2016-12-03 | 使用file_get_contents发送post请求1234567891011$data = ['eat'=>'2kg','run'=>'10km'];$url = 'http://localhost';$context = stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => html_build_query($info), 'timeout' => 3 )));$result = file_get_contents($url, false, $context);