crawlerbasher Posted January 4, 2010 Share Posted January 4, 2010 dose striptag(); strip BB Code tags? or dose it only strip tages incased in <>? Thanks. Link to comment https://forums.phpfreaks.com/topic/187190-striptag-help/ Share on other sites More sharing options...
oni-kun Posted January 5, 2010 Share Posted January 5, 2010 dose striptag(); strip BB Code tags? or dose it only strip tages incased in <>? Thanks. The function strip_tags can only strip tags enclosed within angular brackets ( < , > ). Maybe you can use the following example to strip those types of tags, I'm not sure if it fully works though: <?php $String = "[b]Bold[/b] [u]etc.[/u]"; $String = preg_replace('|[[\/\!]*?[^\[\]]*?]|si', '', $String); echo $String; //Returns: Bold etc. ?> EDIT: Updated the code, it should work now. Link to comment https://forums.phpfreaks.com/topic/187190-striptag-help/#findComment-988492 Share on other sites More sharing options...
crawlerbasher Posted January 5, 2010 Author Share Posted January 5, 2010 its ok I want BB code just not any other kind of tags. Thank you for answering my question. Link to comment https://forums.phpfreaks.com/topic/187190-striptag-help/#findComment-988496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.