This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// some useful regular expressions and sample usage | |
// | |
// convert Twitter usernames into profile links | |
// cred. Simon Granade (http://bit.ly/FihuS) | |
$text = preg_replace('/(^|\s)@(\w+)/', | |
'\1@<a href="http://twitter.com/\2">\2</a>', $text; |
NewerOlder