【发布时间】:2015-06-01 03:14:51
【问题描述】:
file_get_htm 返回 false,但如果我尝试将数据转换为字符串,那么一切正常 ..
$url = "http://www.dkb-handball-bundesliga.de/de/dkb-hbl/spielplan/spielplan-chronologisch/";
$output = file_get_contents($url);
print_r($output); //this return string
$html = file_get_html($url);
print_r($html); //this return false
我尝试使用 curl,但一切都一样......
例如,如果我使用 cgange url,一切正常...
$url='http://www.dkb-handball-bundesliga.de/de/s/spiele/2014-2015/dkb-handball-bundesliga/1--spieltag--bergischer-hc-vs-sg-bbm-bietigheim/';
【问题讨论】:
-
如果这适用于一个页面而不适用于另一个页面,则您正在检索的 HTML 可能已损坏。
标签: php file-get-contents simple-html-dom