【发布时间】:2014-09-05 14:21:36
【问题描述】:
我想禁用file_get_contents 功能以保护网页中的 html 内容。
<?php
$homepage = file_get_contents('http://www.example.net/');
echo $homepage;
?>
我已经完成了allow_url_fopen = Off,但它不起作用。
谁能帮帮我?
【问题讨论】:
-
您可以研究 User-Agent 过滤,这是一种常见的(预计不可靠)解决方法。另外,坦率地说,您博客中的任何内容实际上都不值得复制。
标签: php curl cross-domain