I need to retrieve a HTML file from an external site (http://example.com/page.html) and parse it. Parsing it is fine, however I can't seem to find a way to retrieve the file given this:
- Cannot use cURL
- Must work on PHP 4.3.9+
- Must retrieve the file as a HTTP request
- Must return file as a string
Can anyone suggest something that meets these requirements?
Edit: Running
echo implode('', file('http://www.example.com/'));
returns this:
Warning: file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /www/test.php on line 4
Warning: file(http://www.example.com/): failed to open stream: No such file or directory in /www/test.php on line 4
Warning: implode(): Bad arguments. in /www/test.php on line 4