MyBB Community Forums

Full Version: Link to user profile in the post message?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Guys how to match this with PHP.

@sometext then how to strip @ from the string?
Use the preg_replace function.

$somevariable = preg_replace("/([@]{1})([^\s]{1,})/is", "$2", $post['message']);

Note: The above code will not work with usernames that have spaces.
You are awesome any idea how to make it check for usernames with spaces?
Check out MentionMe which has got many examples on how to accomplish this and other interesting stuff.
Thanks @Shade very much. Sorry but I am still learning more complex coding.