How to get data from a website that uses SSL using cURL and PHP?
问题 I am trying to get some data from a website where you need to have a SSL certificate to be able to connect to it. I have found the following code : // create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, $host); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, $host); // $output contains the output string $output = curl_exec($ch); // close curl resource to free up system resources curl_close($ch); The cURL query works well, but the data