Implementation (url is a valid and running url):
$html = file_get_contents($url);
I am programming a crawler in php and sometimes file_get_contents returns the following error:
failed to open stream: Connection closed
This doesn't always occur, so when it does it confuses me a tad. Would this be an error on my side or the website I am crawling side? Either way is it sensible to keep retrying until an error doesn't occur or is there a better way?
Try this way...