例如:
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的值