• curl获取返回值的问题


    例如:

    URL:http://mytp.com:801/Home/Index/getcurl,

    方法为

    public function getcurl(){
      $aa = "999";echo $aa;
    }

    curl代码是:

    $c = curl_init(); 

    $url = "http://mytp.com:801/Home/Index/getcurl";
    curl_setopt($c, CURLOPT_URL, $url); 
    //Tell curl to write the response to a variable 
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 60); 
    $info = curl_exec($c);

    curl_close($c);

    其中$info就是getcurl方法$aa的值

  • 相关阅读:
    day 38
    day 37
    day 36
    day 35
    day 34
    day 33
    day 32
    day 31
    day 30
    day 29
  • 原文地址:https://www.cnblogs.com/you-jia/p/4118618.html
Copyright © 2020-2023  润新知