Link to user profile in the post message?
#1
Guys how to match this with PHP.

@sometext then how to strip @ from the string?
Reply
#2
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.
Reply
#3
You are awesome any idea how to make it check for usernames with spaces?
Reply
#4
Check out MentionMe which has got many examples on how to accomplish this and other interesting stuff.
[Image: fSGNVQj.png]
Reply
#5
Thanks @Shade very much. Sorry but I am still learning more complex coding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)