您好,欢迎访问一九零五行业门户网

php http 请求数据

$url = 'https://......'; //请求地址
    $ref_url = ''//来源页面
    $data = array(  //提交的数据
        param => ,
        param =>
    );
    $ch = curl_init();
    curl_setopt($ch, curlopt_url, $url);
    curl_setopt($ch, curlopt_useragent, $agent);
    curl_setopt($ch, curlopt_referer, $ref_url);
    curl_setopt($ch, curlopt_post, true); //以post方式提交
    curl_setopt($ch, curlopt_postfields, $data);
    curl_setopt($ch, curlopt_timeout, 30); //超时时间
    $contents = curl_exec($ch); //执行并获取返回数据
    curl_close($ch);
    var_dump($contents);
其它类似信息

推荐信息