This article to: The new Too Current network blog
/** * [curl accessed by get] * @e-mial [email protected] * @TIME 2017-04-07 * @WEB http://blog.iinu.com.cn * @param [data] $url [path visited] * @param string $data [description] * @return [type] [description] */functionCurlget($url,$data=‘‘){$ch=Curl_init();$header= "Accept-charset:utf-8";curl_setopt($ch,Curlopt_url,$url);curl_setopt($ch,Curlopt_customrequest, "GET");curl_setopt($ch,Curlopt_ssl_verifypeer,FALSE);curl_setopt($ch,Curlopt_ssl_verifyhost,FALSE);curl_setopt($ch,Curlopt_httpheader,$header);curl_setopt($ch,Curlopt_useragent, ' Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0) ');curl_setopt($ch,Curlopt_followlocation, 1);curl_setopt($ch,Curlopt_autoreferer, 1);curl_setopt($ch,Curlopt_postfields,$data);curl_setopt($ch,Curlopt_returntransfer, True);$temp=Curl_exec($ch); Return$temp;}/** * [Curl is accessed by post] * @e-mial [email protected] * @TIME 2017-04-07 * @WEB http://blog.iinu.com.cn * @param [data] $url [Path visited] * @param [Type] $data [description] * @return [type] [description] */functionCurlpost($url,$data){$ch=Curl_init();$header= "Accept-charset:utf-8";curl_setopt($ch,Curlopt_url,$url);curl_setopt($ch,Curlopt_customrequest, "POST");curl_setopt($ch,Curlopt_ssl_verifypeer,FALSE);curl_setopt($ch,Curlopt_ssl_verifyhost,FALSE);curl_setopt($curl,Curlopt_httpheader,$header);curl_setopt($ch,Curlopt_useragent, ' Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0) ');curl_setopt($ch,Curlopt_followlocation, 1);curl_setopt($ch,Curlopt_autoreferer, 1);curl_setopt($ch,Curlopt_postfields,$data);curl_setopt($ch,Curlopt_returntransfer, true); $tmpInfo = Curl_exec ($ Ch if (curl_errno $ch { Span class= "KWD" >return false; }else{ return true;}} /span>
This article to: The new Too Current network blog
PHP post/get access to Curl