best way to replace a string?
<pre><code>string '/home/adam/Projects/red/storage/22ff0bc0662bd323891844f6ed342cce2603490ec0_tumb_2.jpg' (length=85)
</code></pre>

<p>what i need is just 
<a href="http://localhost/storage/22ff0bc0662bd323891844f6ed342cce2603490ec0_tumb_2.jpg" rel="nofollow">http://localhost/storage/22ff0bc0662bd323891844f6ed342cce2603490ec0_tumb_2.jpg</a></p>

<p>what is the best way doing it ? i mean useing strlen ? substr_replace ? substr ? im a bit confused what is the best way doing this? becouse there is many ways to do this.</p>

<p>edit* there is no newbie tag :|</p>

<pre><code>    // get from database red/storage/22ff0bc0662bd323891844f6ed342cce2603490ec0_tumb_2.jpg
    $image_path = $this-&gt;data['products'][0]['image_small'];
    $exploded = end(explode('/', $image_path));
    $myurl = DOMAIN;
    $myfullurl = $myurl."/storage/".$exploded;
</code></pre>

<p>// it works!, but let see the comments maybe there is a better way :)</p>
