title: How can I load a remote file using file_get_contents()?
body: <p>Scratching my head a bit now with this.<br>
  I am trying to get a file from a remote url. I can save contents from local files, but can't from remote.</p>
  <p>This works:</p>
  <pre><code>file_put_contents(
      'file1.xml',
      file_get_contents('file2.xml')
  );
  </code></pre>
  <p>This doesn't:</p>
  <pre><code>file_put_contents(
      'file1.xml',
      file_get_contents('http://www.domain.com/xmlapi/search.aspx?query=places&amp;lid=38')
  );
  </code></pre>
  <p>Oddly enough my other scripts worked ok at first try but none will access the remote url now.<br>
  I have recently started to host my new php files on Heart Internet. I have similar scripts on other servers which give no problems at all.</p>
  <p>This is the error I get:</p>
  <blockquote>
  <p>Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/sites/mydomain/myfile.php on line 5`</p>
  <p>Warning: file_get_contents(<a href="http://www.domain.com/xmlapi/search.aspx?query=places&amp;lid=38" rel="nofollow noreferrer">http://www.domain.com/xmlapi/search.aspx?query=places&amp;lid=38</a>) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/sites/mydomain/public_html/myfile.php on line 5`</p>
  </blockquote>
  <p><code>allow_url_fopen</code> is set to <code>On</code></p>
  <p>Different domains</p>