【发布时间】:2013-10-30 10:09:58
【问题描述】:
我正在尝试使用“file_get_contents”将 .php 文件插入网页正文。当显示远程内容时,所有链接都不起作用,因为它在本地请求它们。作为一个新手,有没有办法设置“file_get_contents”输出以显示原始超链接?上下文变量会是解决方案吗?
这是我在网页中的 php:
<?php echo file_get_contents("http://acs.klikapps.co.uk/stock.php"); ?>
谢谢!
【问题讨论】:
-
file_get_contents() 不会为您执行此操作....您需要在变量中获取 file_get_contents() 的结果,然后对其进行解析以识别和修改链接使用domDocument 或类似
标签: php url file-get-contents