Xinu

file_get_content 携带参数方法
function post($url, $data){//file_get_content $opts = ...
扫描右侧二维码阅读全文
17
2018/08

file_get_content 携带参数方法

function post($url, $data){//file_get_content
   $opts = array('http' =>
    array(
        'method'  => 'POST',
        'header'  => array ('Content-type: application/x-www-form-urlencoded',  'response-json:true'),
        'content' => $data
    )
    );
    $context = stream_context_create($opts);
    $result = file_get_contents($url, false, $context);
    return $result;
}
Last modification:April 4th, 2019 at 11:35 am

Leave a Comment