How to change link url from format html?
<p>Here is my code:</p>

<pre><code>$str = '&lt;html&gt;&lt;p&gt;&lt;img src="http://test.com/images.jpg" /&gt;&lt;img src="test.com/image2.jpg"&gt;&lt;p&gt;&lt;html&gt;';
$str_rep = str_replace('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i','http://mywebsite.com/', $str);
</code></pre>

<p>I want to replace the image URL using a regular expression. How can I do this?</p>
