@username and #twitter and links are flat text after using abraham with an array()


#1
<?php session_start(); require_once("twitteroauth/twitteroauth.php"); //Path to twitteroauth library $twitteruser = "hieronymusdesig"; $notweets = 10; $consumerkey = "xxx"; $consumersecret = "xxx"; $accesstoken = "xxx"; $accesstokensecret = "xxx"; function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) { $connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret); return $connection; } $connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret); $tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=".$notweets."&include_entities&exclude_replies=false"); ?>
	<ul>
	<?php foreach($tweets as $item){ ?>
		<li><img class="img-circle" src="<?php echo $item->user->profile_image_url;?>" alt="<?php bloginfo('name');?>" />&nbsp;<span><?php echo $item->text;?></span></li>
	<?php } ?>
	</ul>

This is the code what i am using to get tweets. it works perfectly. However. The result of the text value is just plain text. How do i enable the clickable @username or #somechannel or shortened links.

Thank you very much in advance.


#2

I recommend using twitter-text. There is a PHP version or a JS version that will make it easy.