我想从另一个网站读取文件内容,但无法读取。
我可以访问这两个主机。
我要使用 file_get_contents()
功能。我需要在文件或文件夹的文件目录中更改什么?或者在我的 PHP 文件中?
enter link description here
<?php
$direct="http://nic.subz.ir/api/index.php";
echo $direct;
echo file_get_contents($direct);
?>
最佳答案
在这里写下你的例子并错误你得到的。 如果是关于许可的事情,那么你必须在你的请求中发送用户代理
关于php - 当我想使用 file_get_contents() 时超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37271104/