开发者

simplehtmldom 500 error

开发者 https://www.devze.com 2023-04-04 07:30 出处:网络
I saw that there are a lot of topics on simplehtmldom, but no one\'s problem seems to be mine- specifically, that it just 500s, even on the examples provided.I\'ve found that I can include the file wi

I saw that there are a lot of topics on simplehtmldom, but no one's problem seems to be mine- specifically, that it just 500s, even on the examples provided. I've found that I can include the file without a开发者_JAVA技巧n error, but if I then try to use file_get_html, it 500s. The only thing I found in the manual about installation is a possible problem with allow_fopen_url, which I do.

Something I'm missing?


Seems like too long since you asked this question, but since I came across this trying to solve this problem myself, I thought I'd post what worked for me.

I solved this problem by changing file_get_html to file_get_contents. Since I wanted to use the 'find' feature in simple_html_dom, I had to then convert the string to an object:

$string = file_get_contents(http://thedeadfallproject.com/)
$object = new simple_html_dom();
$object->load($string); // Load HTML from a string
0

精彩评论

暂无评论...
验证码 换一张
取 消