title: Sanitize user-supplied URL for file_get_contents
body: <p>I want to use <code>file_get_contents</code> to implement a proxy so I can do cross domain AJAX requests.  </p>
  
  <p>Query string will be used to supply the URL to <code>file_get_contents</code>. Now the problem is people can muck around with the query string in order to read local files on the server. I don't want this. Can someone get me a function to sanitize the query string in order to accept only URLs and not local files, i.e.:</p>
  
  <ul>
  <li><p><code>?url=http://google.com.au</code> - OK</p></li>
  <li><p><code>?url=./passwords.txt</code> - Not OK</p></li>
  </ul>