title: How can you get the replaced text with preg_replace?
body: <p>I am using the <strong>preg_replace</strong> function in PHP and am trying to replace urls that users submit with bit.ly shortened links:</p>
  
  <pre><code>$comment = preg_replace( '/(http|ftp)+(s)?:(\/\/)((\w|\.)+)(\/)?(\S+)?/i', '', $strText );
  </code></pre>
  
  <p>This will show only the comment and "wipe out" the url. The question is how can I get the URL from the text and append it later?</p>