I'm making a news and comment system at the moment, but I'm stuck at one part for a while now. I want users to be able to refer to other players on the twitter style like @username. The script will look something like this: (not real PHP, just imagination scripting ;3)
$string = "I loved the article, @SantaClaus, thanks for writing!";
if($string contains @){
$word = word after @;
$check = is word in database? ...
}
And that for all the @username's in the string, perhaps done with a while(). I'm stuck, please help.