I have a string, and I need to extract all the twitter usernames from the string. Example:
Hello @twitter and @facebook
I need both those to go into an array with a possible count value too.
So it would look like this:
$username[0] = "twitter";
$username[1] = "facebook";
And I need this for any amount of usernames that can fit into a tweet.
To take this a step further, I needs this so I can turn a simple tweet into one with links.
So
Hello @twitter and @facebook
becomes
Hello <a href="http://twitter.com/twitter">@twitter</a> and <a href="http://twitter.com/facebook">@facebook</a>
Thus rewriting it.