function get_status($twitter_id) { if(!$xml=simplexml_load_file('http://twitter.com/statuses/user_timeline/' .$twitter_id .'.xml?count=1')){ trigger_error('Error reading XML file',E_USER_ERROR); } $status = $xml->status->text; $status=preg_replace("/(http:\/\/|www|[a-zA-Z0-9-]+\.|[a-zA-Z0-9\.-]+@)(([a-zA-Z0-9-][a-zA-Z0-9-]+\.)+[a-zA-Z0-9-\.\/\_\?\%\#\&\=\;\~\!\(\)]+)/","\\1\\2",$status); echo '
' .preg_replace('/(^|[^\w])@([\d\w\-]+)/', '\\1@$2' ,$status) .'
'; echo '