Why does file_get_contents have no data?

$coinbasePublicAPI =" https://api.coinmarketcap.com.";
$coinData = file_get_contents ($coinbasePublicAPI);
var_dump ($coinData); / / Why is the result NULL empty

)

original: https://stackoverflow.com/que.

is it that the person who asked the question used it wrong, or did I misunderstand it? I did print the result empty. Run https://api.coinmarketcap.com. in the browser as shown in figure

.
Php
Mar.11,2021

I have tried, and there is an output


clipboard.png

there is an output. I don't know if the PHP version of Nepal is low, and file_get_contents cannot be linked with https.

it is recommended to switch to curl, so that there is no compatibility problem


just go to php.ini and delete the front of extension=php_openssl.dll; delete

Menu