Skip to content

Instantly share code, notes, and snippets.

@tcarlsen
Created August 17, 2010 11:48
Show Gist options
  • Save tcarlsen/529550 to your computer and use it in GitHub Desktop.
Save tcarlsen/529550 to your computer and use it in GitHub Desktop.
$statusWords = explode(" ",$data['text']);
foreach ($statusWords as $word) {
if (substr($word,0,1) == "@") {
$newWord = '@<a href="#">'.substr($word,1).'</a>';
$data['text'] = str_replace($word,$newWord,$data['text']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment