/* PHP CURL HTTPS POST/function Curl_post_https ($url, $data) {//Simulate submit data function $curl = Curl_init ()//Start a CURL session cur L_setopt ($curl, Curlopt_url, $url); Address to be accessed curl_setopt ($curl, Curlopt_ssl_verifypeer, 0); Inspection of the source of certification certificate ($curl, curlopt_ssl_verifyhost, 1); curl_setopt Check the SSL encryption algorithm for the existence of curl_setopt ($curl, curlopt_useragent, $_server[' http_user_agent ') from the certificate; Analog user-used browser curl_setopt ($curl, curlopt_followlocation, 1); Use automatic jump curl_setopt ($curl, Curlopt_autoreferer, 1); Automatically set Referer curl_setopt ($curl, Curlopt_post, 1); Send a regular POST request curl_setopt ($curl, Curlopt_postfields, $data); Post-Submitted packet curl_setopt ($curl, Curlopt_timeout, 30); Set timeout limit to prevent dead loop curl_setopt ($curl, Curlopt_header, 0); Displays the contents of the header area returned curl_setopt ($curl, Curlopt_returntransfer, 1); The information obtained is returned in the form of a file stream $tmpInfo = curl_exec ($curl); Execute action if (Curl_errno ($curl)) {echo ' errno '. Curl_error ($curl);//Catch Exception} curl_close ($curl); Close Curl Session return $TMpinfo; Return data, JSON format}
$rst = Curl_post_https ($url, $data);
$rst;