When did the behavior of PHP about it change?
What version of PHP is this from?
Warning: file_get_contents (): the stream does not support searching in / simple _html_dom.phpWarning: file_get_contents (): Could not find position -1 in the stream in / simple _html_dom.php
Warning: file_get_contents (): the stream does not support searching in / simple _html_dom.php
Warning: file_get_contents (): Could not find position -1 in the stream in / simple _html_dom.php
include('parser/simple_html_dom.php'); $url = "https://en.wikipedia.org/wiki/Stack_Overflow"; $html = file_get_html($url); if ($html !== false) { foreach($html->find('div#mw-content-text') as $item){ $item->plaintext; } }
See file_get_contents (): stream does not support PHP search
You are working with a remote file. Search is supported only for local files.
You probably need to copy the file to the local file system before using file_get_html. It should work well on the local host.
file_get_html
, , simple_html_dom.php, ( ).
simple_html_dom.php
75 simple_html_dom.php:
$contents = file_get_contents($url, $use_include_path, $context, $offset);
$offset:
$offset
$contents = file_get_contents($url, $use_include_path, $context);
. - , !:)
function file_get_html(..., $offset = -1,...)
function file_get_html(..., $offset = 0,...)
simple_html_dom.php $offset - 75 76. .
Source: https://habr.com/ru/post/1015600/More articles:How can I override a selector with many negatives (: not)? - cssRun TypeScript Compile after changing version control files - gitPython / Pandas: matching a list of rows with a DataFrame column - pythonThe difference in the behavior of max_element and minmax_element in C ++ STL - c ++Adding bootstrap to a Vue CLI project - twitter-bootstrapfile_get_contents (): stream does not support PHP search - phpUnable to create create-Reaction-app project with custom PUBLIC_URL - javascriptHow to develop embedded widgets using Angular 2 for third-party sites - angularTypeScript how to format an array of an object into a json array - jsonChrome web browser and user tab - androidAll Articles