lauhp
function _post($url,$post_data){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    // post数据
    curl_setopt($ch, CURLOPT_POST, 1);
    // post的变量
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    $output = curl_exec($ch);
    curl_close($ch);
    //打印获得的数据
    return $output;
}


function _get($url){
    $ch = curl_init($url) ;  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ; // 获取数据返回  
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ; // 在启用 CURLOPT_RETURNTRANSFER 时候将获取数据返回  
    $output = curl_exec($ch) ; 
    curl_close($ch);
    //打印获得的数据
    return $output;
}

分类:

技术点:

相关文章:

  • 2021-08-09
  • 2021-08-04
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
猜你喜欢
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
相关资源
相似解决方案