PHP: BBCode with SQL selection?

Posted by rayne on Stack Overflow See other posts from Stack Overflow or by rayne
Published on 2010-05-10T08:17:16Z Indexed on 2010/05/10 9:54 UTC
Read the original article Hit count: 413

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about preg-replace