Jump to content

nl2br with no <br /> tags in bbcode


The Little Guy

Recommended Posts

I have this code, and I don't want to allow any tags, eccept for the nl2br, but I don't want those < br /> tags to be placed between any [ php] and [/code] (without the space) bbcode, how can I do this?

$id = $_GET['id'];
$name = strip_tags(addslashes(findURL($_POST['name'])));
$find = array('<?','<?php','?>');
$replace = array('[[?','[[?php','?]]');
$comment = str_replace($find,$replace,$_POST['comment']);
$comment = strip_tags(findURL($comment));
$comment = nl2br($comment);
$comment = addslashes($comment);

 

I hope that all makes sense

Link to comment
https://forums.phpfreaks.com/topic/38508-nl2br-with-no-tags-in-bbcode/
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.