Basically suppose you have twitter message in plain text form and you may want to display it on a webpage with all @names pointing to twitter profiles and links to apporpriate pages
just use the following php function
function formatTweet($tweet)
{
//select hyperlinks
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",
"\\0", $tweet);
$text = ereg_replace("@([a-zA-Z0-9_]+)","@\\1",$text);
return $text;
}
Friday, June 12, 2009
Subscribe to:
Posts (Atom)