The Little Guy Posted February 14, 2007 Share Posted February 14, 2007 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 More sharing options...
pkSML Posted February 14, 2007 Share Posted February 14, 2007 Just a thought... Inside your [ php] [/code] tags, replace the newline character with a non-important character, like ». Run nl2br, and then replace » with whatever you want. Link to comment https://forums.phpfreaks.com/topic/38508-nl2br-with-no-tags-in-bbcode/#findComment-184808 Share on other sites More sharing options...
The Little Guy Posted February 14, 2007 Author Share Posted February 14, 2007 Im not quite sure what you mean there Link to comment https://forums.phpfreaks.com/topic/38508-nl2br-with-no-tags-in-bbcode/#findComment-184827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.