我正在使用 fopen 来检索 URL 的内容。它适用于 http URL,但不适用于 https URL
任何人都可以看到为什么?
<?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;
}
//
?>