404 looks like the standard response code you provided for the URL:
$ curl -I http://www.x-rates.com/d/TRY/table.html HTTP/1.1 404 Not Found Date: Mon, 01 Aug 2011 12:23:49 GMT Server: Apache/2.2.19 Content-Type: text/html
You can get the body of the HTTP response and load it with DomDocument as a string.
This can be done by using file_get_contents Docs and setting the ignore_errors HTTP context parameter . Code example:
$url = 'http://www.x-rates.com/d/TRY/table.html'; // Create a stream $opts = array( 'http'=>array( 'ignore_errors'=> true, ) ); $context = stream_context_create($opts); // Open the file using the HTTP headers set above $file = file_get_contents($url, false, $context); $doc = new DOMDocument(); $doc->loadHTML($file);
hakre
source share