我正在使用fopen来检索URL的内容.它适用于http网址,但不适用于https网址
谁能明白为什么?
<?php
//this works fine
echo ("<br><br>url 1 is ".OutputURL("http://nuenergy.acornsoftware.com.au/staff/interface/index.php"));
//returns nothing
echo ("<br><br>url 2 is ".OutputURL("https://nuenergy.acornsoftware.com.au/staff/interface/index.php"));
function OutputURL($url)
{
$handle = fopen($url, "r");
$contents = stream_get_contents($handle);
fclose($handle);
return $contents;
}
//
?>
Run Code Online (Sandbox Code Playgroud)