title: php file_get_contents($url) & turns into &amp;
body: <p>I am trying to make a request to the coinbase api like this</p>
  
  <pre><code>$url = "https://api.gdax.com/products/BTC-USD/candles?start=".date($format,$starting_date)."&amp;end=".date($format,$ending_date)."&amp;granularity=".$granularity;
  </code></pre>
  
  <p>and then I pass that in <code>file_get_contents($url)</code> but it gives me an error</p>
  
  <p>file_get_contents(<code>https://api.gdax.com/products/BTC-USD/candles?start=2015-05-07&amp;amp;end=2015-05-08&amp;amp;granularity=900</code>): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request.</p>
  
  <p>The problem of course is when the '&amp;' gets changed into '&amp;'.</p>