This article mainly introduces how php uses curl to open an https website. It involves php's skills in using curl to connect to a website and obtain information. For more information, see
This article mainly introduces how php uses curl to open an https website. It involves php's skills in using curl to connect to a website and obtain information. For more information, see
This example describes how php uses curl to open an https website. Share it with you for your reference. The specific implementation method is as follows:
$ Url = 'https: // www.google.com.hk '; $ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_HEADER, false ); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true), curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false), curl_setopt ($ ch, CURLOPT_USERAGENT, 'mozilla/5.0 (Windows NT 6.1) appleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.20.1.1 Safari/100'); $ res = curl_exec ($ ch); $ rescode = curl_getinfo ($ ch, CURLINFO_HTTP_CODE ); curl_close ($ ch); echo $ res;
I hope this article will help you with php programming.
,