title: Replace specific URL in string with php
body: <p>A string contains various urls like this:</p>
  
  <pre><code>http://www.example.com/viewtopic.php?f=36&amp;t=457
  http://www.example.com/viewtopic.php?f=36&amp;t=11782
  </code></pre>
  
  <p><strong>Example with 1 URL:</strong></p>
  
  <pre><code>Lorem ipsum dolor sit amet, http://www.example.com/viewtopic.php?f=36&amp;t=457 consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
  </code></pre>
  
  <p><strong>Example with 2 URLs</strong></p>
  
  <pre><code>Lorem ipsum dolor sit amet, http://www.example.com/viewtopic.php?f=36&amp;t=457 consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. http://www.example.com/viewtopic.php?f=36&amp;t=11782 At vero eos et accusam et justo duo dolores et ea rebum.
  </code></pre>
  
  <p>The URLs inside the text must be replaced with new seo urls. </p>
  
  <pre><code>http://www.example.com/viewtopic.php?f=36&amp;t=457
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>http://www.example.com/this-ist-the-new-url.html
  </code></pre>
  
  <p>The Seo URLs will be generatred by a function. </p>
  
  <p>How is it possible to search and replace the FULL url with a other URL inside a string when the URL contains this:</p>
  
  <pre><code>http://www.example.com/viewtopic.php
  </code></pre>
  
  <p>Thank you very much.</p>