Advertisement
Guest User

Untitled

a guest
Nov 11th, 2014
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.20 KB | None | 0 0
  1. $screen_name = "Test";
  2. $mention = "@".$mention;
  3. $mention_link = "<a href='#'>".$screen_name.'</a>';
  4. $tweet = "This is a @Test tweet";
  5.  
  6. $tweet = preg_replace('/(?<!\w)@test/m', $mention_link, $tweet);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement