title: PHP: How to resolve a relative url
body: <p>I need a function that given a relative URL and a base returns an absolute URL. I've searched and found many functions that do it different ways.</p>
  
  <pre><code>resolve("../abc.png", "http://example.com/path/thing?foo=bar")
  # returns http://example.com/abc.png
  </code></pre>
  
  <p>Is there a canonical way?</p>
  
  <p>On this site I see great examples for python and c#, lets get a PHP solution.</p>