- function mycurl($url) {
- if(1){
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_TIMEOUT, 10);
- if(1){
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- }else{
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
- }
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1);
- $res = curl_exec($curl);
- if(curl_errno($curl)){
- debug(curl_errno($curl).' : '.curl_error($curl));
- }
- curl_close($curl);
- }else{
- $res = dfsockopen($url);
- }
- return $res;
- }
复制代码
|