PHP: BBCode with SQL selection?
- by rayne
I would like to code a bbcode with SQL selection. Basically I want the user to be able to input [user]Anotheruser[/user] in a text field, which then is converted in the front-end to an URL that looks like this: http://mydomain.com/user/[userid]/anotheruser. So in order to get the userid, I'd need to include an SQL selection, and additionally an if else to find out of the other user actually exists. Can I do this with a preg_replace as usually used for creating bbcode, or do I need to do something more complex?