Jump to content

bbcode help


adamlacombe

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.