function post2($url, $data){//file_get_content ??????????????????$postdata = http_build_query( ????????????$data ????????); ??????????????????$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($url, false, $context); ????????return $result; ?????}
php请求php
原文地址:http://www.cnblogs.com/weiyiyong/p/7676416.html