title: How to replace a variable within a string with PHP?
body: <p>So I have some PHP code that looks like:</p>
  
  <pre><code>$message = 'Here is the result: %s';
  </code></pre>
  
  <p>I just used %s as an example. It's basically a placeholder for whatever will go there. Then I pass the string to a function and I want that function to replace the %s with the value.</p>
  
  <p>What do I need to do to achieve this? Do I need to do some regex, and use preg_replace(), or something? or is there a simpler way to do it?</p>