file_get_contents(): stream does not support seeking / When was PHP behavior about this changed?

后端 未结 7 1648
醉酒成梦
醉酒成梦 2020-12-06 05:00

When was PHP behavior about this changed?

From which PHP version is it?


Warning: file_get_contents(): stream does not supp

7条回答
  •  清歌不尽
    2020-12-06 05:27

    You don't need to edit the vendor files. Just change your requests from:

    $html = HtmlDomParser::file_get_html( "https://www.google.com/");
    

    to:

    $html = HtmlDomParser::file_get_html( "https://www.google.com/", false, null, 0 );
    

    The problem is that the default offset used by Simple HTML DOM is "-1" when you want it to be "0". Luckily it accepts it as a parameter, which means you can change it easily without needing to change the Simple HTML DOM source.

    Note: This compatibility issue was fixed in v1.7+

提交回复
热议问题