adamlacombe Posted August 4, 2010 Share Posted August 4, 2010 I'm trying to work on BBCode for a forum. I have this: <?php $bb_Code = array( '[ code]' => '<code>', '[ /code]' => '</code>' ); foreach ($bb_Code as $value => $replace) { $text = str_replace($value, $replace, $text); } ?> Question is.. how would I get it so when I insert information into the database it gets cleaned (strip_tags, etc.) but doesn't disturb what is in the [ code ] tags? So basically it makes the html, etc. in the [ code ] tags just plain text? Thanks in advanced. Link to comment https://forums.phpfreaks.com/topic/209839-bbcode-help/ Share on other sites More sharing options...
adamlacombe Posted August 4, 2010 Author Share Posted August 4, 2010 no ideas? Link to comment https://forums.phpfreaks.com/topic/209839-bbcode-help/#findComment-1095370 Share on other sites More sharing options...
adamlacombe Posted August 5, 2010 Author Share Posted August 5, 2010 Hmmmm..... Link to comment https://forums.phpfreaks.com/topic/209839-bbcode-help/#findComment-1095398 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.