Curl get web page (PHP code function)

From , 5 Years ago, written in PHP, viewed 216 times.
URL https://pastebin.vip/view/ccf81119
  1. //CURL获取网页(PHP代码函数)
  2. //代码来源:Monxin ./config/functions.php
  3.  
  4. function curl_open($url){
  5.         $ch = curl_init();  
  6.         curl_setopt($ch, CURLOPT_URL, $url);  
  7.         curl_setopt($ch, CURLOPT_HEADER, false);  
  8.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
  9.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  
  10.         curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.1 Safari/537.11');     
  11.         $res = curl_exec($ch);  
  12.         $rescode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
  13.         curl_close($ch) ;  
  14.         return $res;  
  15. }
  16. //php/9072

Reply to "Curl get web page (PHP code function)"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website