Unlike the ordinary HTTP protocol, when using the function file_get_contents() in PHP to obtain the data provided in the API, an error will occur.
This is because there is no parameter enabled in the PHP configuration file. On my local computer, it is the;extension=php_openssl.dll item in /apache/bin/php.ini. You need to change the previous Remove the semicolon. You can use the following script to check the configuration of your PHP environment:
##The output is as follows: If you are using a remote host and cannot modify the configuration, Another commonly used function to capture content in PHP is curl. It is more powerful than file_get_contents() and provides a lot of optional parameters. For the problem of accessing HTTPS content, the CURL configuration parameters we need to use are: It can be understood from the semantics, it is ignore/skip SSL security verification. The following is a function encapsulated by Curl that can access HTTPS content:##