-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file_get_contents(): stream does not support seeking #48
Comments
From: http://php.net/manual/en/function.file-get-contents.php "The offset where the reading starts on the original stream. Negative offsets count from the end of the stream. Seeking (offset) is not supported with remote files. Attempting to seek on non-local files may work with small offsets, but this is unpredictable because it works on the buffered stream."
|
But let say I want to grab a page using this: ` $file_name = file_get_contents("https://google.com");
`
|
Hello there! May I suggest you a better way to achieve that - using cURL. I've had compatibility issues and all too, but most it got solved when I referred to cURL for pulling pages... I will suggest you some code and sources:
|
hi @XTard, First of all thanks for the reply 👍 :). |
@dseegers
(1)The problem here is that (1)php.net:
(2)PHP Simple HTML DOM Parser Manual:
|
(1/1) ErrorException
file_get_contents(): stream does not support seeking
$html = HtmlDomParser::file_get_html('http://www.google.com/');
foreach($html->find('a') as $element)
echo $element->href . '
';
The text was updated successfully, but these errors were encountered: