Php captures the https content code. If file_get_contents is used directly, an error is returned. the copied code is as follows: $ url (xxx.com); file_get_contents ($ url); error: Warning: file_get_contents (xxx.com) [funct uses file_get_con, an error is reported;
The code is as follows:
$ Url = (https://xxx.com ");
File_get_contents ($ url );
Error:
Warning: file_get_contents (https://xxx.com) [function. file-get-contents]: failed to open stream: No such file or directory in D: wampwwwgrabber_clientindex.php on line 3
The curl method is acceptable:
The code is as follows:
$ Url = (https://xxx.com );
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false );
$ Result = curl_exec ($ ch );
Print_r ($ result );
?>
The following two statements are important:
The code is as follows:
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false );
Pipeline code: $ url = (https://xxx.com "); file_get_contents ($ url); error: Warning: file_get_contents (https://xxx.com) [funct...