in php how do I use preg replace to turn a url into a tinyurl

Posted by Steven on Stack Overflow See other posts from Stack Overflow or by Steven
Published on 2010-03-12T19:38:21Z Indexed on 2010/03/12 19:47 UTC
Read the original article Hit count: 489

Filed under:
|
|

I need to convert a string of text containing a long url into the same string but with a tinyurl (using the tinyurl api). eg. convert "blah blah blah /http://example.com/news/sport blah blah blah" into "blah blah blah http://tinyurl.com/yaeocnv blah blah blah".

How can it be done? PLEASE NOTE I added a slash before the long url as I'm only allowed to post one link

© Stack Overflow or respective owner

Related posts about php

Related posts about preg