Hi,
I am trying to build a Twiiter website widget using the Twitter API, that will display a list of recent tweets.
I am stuck on one piece which is the display of the URLs in the tweet.
I am using preg_replace to look through the text and find a match and replace etc.. as below:-
$text = preg_replace('/(https{0,1}:\/\/[\w\-\.\/#?&=]*)/', '<span class="tweet_links_intext"><a href="$1" target="_blank">$1</a></span>', $text);
This works perfectly correctly but with one exception, the links are now displayed with the preceeding http://
How can I get the links to be displayed and be clickable without the preceeding http://
I have tried changing the above code around by replacing the $1 between the anchor tags with the actual entity tag from the Twitter API i.e.
status->user->display_url
but this does not work at all.
Any help would be appreciated.
Kind regards..,
MT