Jump to content

striptag help


crawlerbasher

Recommended Posts

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

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.