PDA

View Full Version : remove vBcode with PHP?


Swedie
02-23-2005, 09:37 AM
Hey

I need to remove [ B ] and similar vBcode from a $tring. I've tried using vB's built in function called parse_bbcode.. but it doesn't remove vBcode, just turns it into what the user want or leaves it as is. I want to remove the vBcode completely.

I bet it's some type of preg_match thingy I would have to do but I don't know what or how.

thanks

sabret00the
02-23-2005, 09:58 AM
Hey

I need to remove [ B ] and similar vBcode from a $tring. I've tried using vB's built in function called parse_bbcode.. but it doesn't remove vBcode, just turns it into what the user want or leaves it as is. I want to remove the vBcode completely.

I bet it's some type of preg_match thingy I would have to do but I don't know what or how.

thanks
you could use eregi/preg_replace but why not just use some of the strip_bbcode functions, search functions_bbcodeparse.php for "strip" theirs about 10 functions that will do what you need.

Swedie
02-26-2005, 02:06 PM
you could use eregi/preg_replace but why not just use some of the strip_bbcode functions, search functions_bbcodeparse.php for "strip" theirs about 10 functions that will do what you need.
I did, but thought stripslashes had something else to do it that could "do it" :p oh well. just used a str_replace instead. thanks anyhow.