title: PHP: building a URL path
body: <p>I have a few strings to combine to build a full path. e.g.</p>
  
  <pre><code>$base = "http://foo.com";
  $subfolder = "product/data";
  $filename = "foo.xml";
  
  // How to do this?
  $url = append_url_parts($base, $subfolder, $filename); ???
  </code></pre>
  
  <p>String concatenation won't do, that would omit the necessary forward slashes.</p>
  
  <p>In Win32 I'd use PathCombine() or PathAppend(), which would handle adding any necessary slashes between strings, without doubling them up. In PHP, what should I use?</p>