Tandem Posted July 26, 2006 Share Posted July 26, 2006 I've been trying to implement bbcode onto my website, but it's not working out. I just don't understand how to do it, and just about all the tutorials i come across are terribly written/wrong. I did find a custom made file that parses tags, but the if you miss off a closing tag or make a similar mistake, it would destroy the page's layout, and i don't want to user input pages to be able to do that.Can somebody point me towards some good documentation for using the PEAR bbcode parser or possibly explain how i go about using it themselves?Thankyou for any help. Quote Link to comment https://forums.phpfreaks.com/topic/15646-bbcode-parsing/ Share on other sites More sharing options...
High_-_Tek Posted July 26, 2006 Share Posted July 26, 2006 Please point out any holes in my function but this is a simple version of what i've been using lately:<?phpfunction parse_BBCode($input_str) { preg_match("#\[b\](.*?)\[b\]#i", $input_str, $matches); $input_str = preg_replace("#\[b\](.*?)\[\\b\]#i", "<b>".$matches[1]."</b>", $input_str); ... more BBCode->HTML regexsreturn $input_str; }?> Quote Link to comment https://forums.phpfreaks.com/topic/15646-bbcode-parsing/#findComment-63784 Share on other sites More sharing options...
Tandem Posted July 26, 2006 Author Share Posted July 26, 2006 Wouldn't it be easier to use the PEAR bbcode parser? Quote Link to comment https://forums.phpfreaks.com/topic/15646-bbcode-parsing/#findComment-63793 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.