title: HTTP request failed! HTTP/1.0 400 Bad Request when trying to get content from youtube
body: <p>I get this error when I try to get content from youtube with more then one word.</p>
  
  <pre><code>Warning: file_get_contents(https://www.youtube.com/results?search_query=html begginer): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in C:\xampp\htdocs\sites\mime\beta\default.php on line 5
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
      $address = $_GET['q'];
      $address = 'https://www.youtube.com/results?search_query=' . $address;
  
      $html = file_get_contents($address);
      echo $html;
  ?&gt;
  </code></pre>
  
  <p>However, if I try to get content from youtube using only one word (for example: <code>http://127.0.0.1/sites/mime/beta/default.php?q=html</code>), the script work perfectly.</p>
  
  <p>What's wrong?</p>