title: Best way to do string format in PHP
body: <p>I have following python code to format the string,</p>
  
  <pre><code>endpoint = '/uri/{id}'
  params = {'id': xxxx}
  endpoint.format(**params)
  </code></pre>
  
  <p>which is given me a following result,</p>
  
  <pre><code>'/uri/xxxx'
  </code></pre>
  
  <p>I need to develop a function in PHP which is doing the same thing, and I found a <a href="https://stackoverflow.com/questions/16632067/php-equivalent-of-pythons-str-format-method">question</a> related this but still I’m not satisfy with that.</p>
  
  <p>What would be the best way to do this kind of a thing with PHP?</p>
  
  <p>Thanks in advance</p>