Thank you Sir.
Armed with that I went searching on Google and found this:
Code:
function stripBBCode($text_to_search) {
$pattern = '|[[\/\!]*?[^\[\]]*?]|si';
$replace = '';
return preg_replace($pattern, $replace, $text_to_search);
}
but it zaps *all* BBCode. Would anyone have any idea on how to make it *not* remove things like:
[ QUOTE ]
[ /QUOTE ]
[ QUOTE=
[ B ]
[ I ]
[ U ]
or any of the other basic ones? (spaces included on purpose so the forum doesn't try and use them)
I did find this function as well:
Code:
function stripBBCode($stringInput) {
if (strpos($stringInput, '[') !== false) {
$validBBCodeArray = array(
'b',
'i',
'u',
'url',
'quote',
);
$validBBCode = join('|', $validBBCodeArray);
$stringOutput = preg_replace(
'@\[(?:\/{0,1}?)(?:' . $validBBCode . ')(?:\s{0,1}?)(?:\/{0,1}?)\]@',
'',
$stringInput
);
} else {
$stringOutput = $stringInput;
}
return $stringOutput;
}
but it strips everything *except* font and size tags (for some reason).
All the help so far is being appreciated I assure you. Now for that last little step
Cheers
Bruce