title: Replacing tokens in a string from an array
body: <p>Let's say I have a string</p>
  
  <blockquote>
    <p>This $0 is $2 $1. Still, \$$3 is a lot to pay for a puppy.</p>
  </blockquote>
  
  <p>and an array of replacements</p>
  
  <pre><code>array('puppy', 'cute', 'ridiculously', '1300')
  </code></pre>
  
  <p>What would be the cleanest way to replace the tokens in the string with the corresponding items in the array, letting me backslash-escape the token character (in this case <code>$</code>)? I also want to replace unmatched tokens with the empty string.</p>