title: PHP replace params in api url pattern
body: <p>I have some api pattern url with params:</p>
  
  <p><code>http://api.example.com/{type}/{function}?{parameters}&amp;lang={lang}&amp;authkey={authkey}&amp;username={username}</code></p>
  
  <p>What is the best way to replace params for values, maybe some magic class there is?</p>
  
  <p>Thanks in advance.</p>