Replace a flickr image url from big to small size with substr_replace


I have been trying out the change the flickr image url from the big size to small and medium size without using the image url’s again.I have landed up with the solution.

<?php
$url="http://farm5.static.flickr.com/4074/4940684667_9c99ff0288_b.jpg";
echo substr_replace($url,"m",-5,1);
echo "<br />";
echo $url;
?>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s