Can some bright spark help me convert http://twitpic.com/7jeug to http://twitpic.com/show/thumb/7jeug.jpg ? I'm terrible with regular expressions and it's driving me crazy 🙁
Any help would be great. Thank you.
No need for regexp.
$url = "http://twitpic.com/7jeug"; $str = substr($url, 7); $parts = explode("/", $str); $url = "http://" . $parts[0] . "/show/thumb/" . $parts[1]; echo $url;
Oh wow. Thank you very much. Trust me to overcomplicate things.
Much appreciated.