Here is what I have
<img src="http://some.site.com/v/b/image-name/_thumb_100x100.jpg">
I'm trying to modify the src by replacing the size to _thumb_200x200.jpg
i tried preg_replace()
but nothing .
Here is what I have
<img src="http://some.site.com/v/b/image-name/_thumb_100x100.jpg">
I'm trying to modify the src by replacing the size to _thumb_200x200.jpg
i tried preg_replace()
but nothing .
Assuming you have that code in a string, you can use str_replace:
$str = str_replace('_thumb_100x100.jpg', '_thumb_200x200.jpg', $str);
Here's how to do it with preg_replace
$src="http://some.site.com/v/b/image-name/_thumb_100x100.jpg";
echo preg_replace('/_thumb_100x100.jpg/','_thumb_200x200.jpg',$src);