If I have a string of text from Twitter, such as:
$string = "This is a link http://t.co/252351ga to follow.";
How can I unwrap the link, and re-insert into the original string as follows:
$new_string = "This is a link http://www.example.org/article/23534 to follow.";
You probably want to use something like preg_replace and use a pattern to match URLs and replace the match with your own URL.
EDIT:
You can find a good URL regexp here:
http://flanders.co.nz/2009/11/08/a-good-url-regular-expression-repost/
Then use it as follows: