title: PHP file_get_contents returns just newlines
body: <p>I have just a PHP script for HTML parsing and it works on simple web sites, but now I need to parse the cinema program from <a href="http://www.cinemacity.cz/en/" rel="nofollow">this website</a>. I am using the <code>file_get_contents</code> function, which returns just 4 new line delimiters <code>\n</code> and I just can't figure out why.
  The website itself will be more difficult to parse with DOMDocument a XPath because the program itself is just pop-up window and it doesn't seem to change the URL address but I will try to handle this problem after retrieving the HTML code of the site.</p>
  
  <p>Here is the shortened version of my script:</p>
  
  <pre><code>&lt;?php
        $url = "http://www.cinemacity.cz/";
        $content = file_get_contents($url);
        $dom = new DomDocument;
        $dom-&gt;loadHTML($content);
  
        if ($dom == FALSE) {
          echo "FAAAAIL\n";
        }
  
        $xpath = new DOMXPath($dom);
  
        $tags = $xpath-&gt;query("/html");
  
        foreach ($tags as $tag) {
          var_dump(trim($tag-&gt;nodeValue));
        }
  ?&gt;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>So, following the advice by WBAR (thank you), I was looking for a way how to change the header in file_get_contents() function a this is the answer I've found elsewhere. Now I am able to obtain the HTML of the site, hopefully I will manage parsing of this mess :D</p>
  
  <pre><code>&lt;?php
      libxml_use_internal_errors(true);
      // Create a stream
      $opts = array(
        'http'=&gt;array(
          'user_agent' =&gt; 'PHP libxml agent', //Wget 1.13.4
          'method'=&gt;"GET",
          'header'=&gt;"Accept-language: en\r\n" .
                    "Cookie: foo=bar\r\n"
        )
      );
      $context = stream_context_create($opts);
  
      // Open the file using the HTTP headers set above
      $content = file_get_contents('http://www.cinemacity.cz/', false, $context);
  
      $dom = new DomDocument;
      $dom-&gt;loadHTML($content);
  
      if ($dom == FALSE) {
          echo "FAAAAIL\n";
      }
  
      $xpath = new DOMXPath($dom);
  
      $tags = $xpath-&gt;query("/html");
  
      foreach ($tags as $tag) {
          var_dump(trim($tag-&gt;nodeValue));
      }
  ?&gt;
  </code></pre>