Reputation: 11981
Code:
<?php
$string = file_get_contents($url);
var_dump($string);
?>
There are different results from file_get_contents()
for two different hosts.
Is there any server configuration that I have to change?
Upvotes: 2
Views: 233
Reputation: 7249
Try this:
$context = stream_context_create(array(
'http' => array(
'method' => 'GET',
'header' => implode("\r\n", array(
'Accept-Charset: ISO-8859-1',
'Accept-Encoding: ',
)),
)));
$string= file_get_contents($url, null, $context);
var_dump($string);
Upvotes: 3
Reputation: 52372
It looks gzipped. I suggest using a more intelligent utility than file_get_contents, like cURL.
Upvotes: 1