title: Change img src from database with regex?
body: <p>I have in database column content for example with this:</p>
  
  <pre><code>&lt;table border="0" cellspacing="1" cellpadding="1" width="200" align="center"&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;a href="http://example.cz/cz/katalog/some_product/"&gt;
                 &lt;img src="http://example.cz/article/3584/photo/some_product.jpg" /&gt;
              &lt;/a&gt;
          &lt;/td&gt;
  
          &lt;td&gt;
              &lt;a href="http://example.cz/cz/katalog/some_product2/"&gt;
                 &lt;img src="http://example.cz/article/3584/photo/some_product2.jpg" /&gt;
              &lt;/a&gt;
          &lt;/td&gt;
     ...
  </code></pre>
  
  <p>If i make a mysql query to get this content I need change the source of image and href tag to another website (path is same) for example like this:</p>
  
  <pre><code>&lt;table border="0" cellspacing="1" cellpadding="1" width="200" align="center"&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;a href="http://anotherWebsite.cz/cz/katalog/some_product/"&gt;
                 &lt;img src="http://anotherWebsite.cz/article/3584/photo/some_product.jpg" /&gt;
              &lt;/a&gt;
          &lt;/td&gt;
  
          &lt;td&gt;
              &lt;a href="http://anotherWebsite.cz/cz/katalog/some_product2/"&gt;
                 &lt;img src="http://anotherWebsite.cz/article/3584/photo/some_product2.jpg" /&gt;
              &lt;/a&gt;
          &lt;/td&gt;
     ...
  </code></pre>
  
  <p>I tried function:</p>
  
  <pre><code>    str_replace('example', 'anotherWebsite', $content);
  </code></pre>
  
  <p>but without result. Is any another way to replace it? For example with regex? If regex is the way can you show me how? Because I'm not good with regex. Really thanks.</p>