i want to use BB code on my shoutbox, how would i parse it with PHP?
Code your own parser using RegExp.
Make it take the inputted string, and change the UBBC items to HTML items!![]()
i want to use BB code on my shoutbox, how would i parse it with PHP?
Regular Expressions is the best method I know, and it works quite well on my shoutbox. Peter (former PBsupport mod) claims there is a more 1337 method, but he never got back to me on what that was![]()
How much do you know about regular expressions?
That's not a bad idea!
Would that be easier than preg_replace?
That's not a bad idea!
Would that be easier than preg_replace?
preg_replace() is Regular Expressions.![]()
oopsie, thanks.
i want to use BB code on my shoutbox, how would i parse it with PHP?
Regular Expressions is the best method I know, and it works quite well on my shoutbox. Peter (former PBsupport mod) claims there is a more 1337 method, but he never got back to me on what that was![]()
How much do you know about regular expressions?
Well I know one alternative method is to split the string into sections and walk through each section rebuilding the formatted text as you go. That's how I wrote both the table parser and the quote parser here. But that still uses some regular expressions and I don't see how it'd make parsing simplier tags such as bold or italic any better.
There are ones premade you can use.
http://www.corz.org has a nice one. ^_^
~Artemis