title: PHP preg_replace with logic?
body: <p>What if I want to multiply all numbers by 2? Can this be done with regex replace? Note the <code>$1*2</code> part that obviously doesn't work. How would I do this?</p>
  
  <pre><code>$foo = "soup 12 cake 23 pants";
  $bar = preg_replace('~(\d+)~', $1*2, $foo);
  </code></pre>