简单的html dom url出错

时间:2013-02-08 07:39:45

标签: php simple-html-dom

我正在使用Simple html dom,我遇到了这个问题:

Warning: file_get_contents(http://forums.xxxxx.co.il/viewtopic.php?f=1015&t=14635609) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\wamp\www\forums_walla\simple_html_dom.php on line 76

我认为问题是&哪里应该只有&

有谁知道该怎么办?或者应该修复什么?

btw代码是这样的:

$href1 = "http://forums.xxxx.co.il/".$topic_page_href; // where $topic_page_href contains the link to next page as --> viewtopic.php?f=1015&t=14635609 which was scrapped from a page)
$topic_page = file_get_html($href1);

如果我这样做

$href1 = "http://forums.xxxx.co.il/viewtopic.php?f=1015&t=14635609
$topic_page = file_get_html($href1);

一切都很好。

我一直试图解决它,因为yester但没有。希望有人有解决方案。提前thx:)

请询问所需的任何内容。

1 个答案:

答案 0 :(得分:1)

将字符串输入

htmlspecialchars_decode()

Documentation here