$user=$row['nick']; if (preg_match("/me", $msg, $msg_1)) { $msg=str_replace ("/me","<i>".$user."",$msg); $user=""; }