简体   繁体   English

如何从sceditor textarea结果中删除标签

[英]How to remove tags from sceditor textarea result

I m using sceditor in website if i add some text into and change styles and save into database. 如果在其中添加一些文本并更改样式并保存到数据库中,则我在网站中使用sceditor。 it storing with sceditor tags like, 它存储着诸如sceditor的标签,

[u][i][b]Hello[/b][/i][/u]

How to remove this tags using php or javascript or jquery. 如何使用php或javascript或jquery删除此标签。

Just Try with this. 只是尝试与此。

<?php
function stripSquareTags($text) {
 $pattern = '|[[\/\!]*?[^\[\]]*?]|si';
 $replace = '';
 return preg_replace($pattern, $replace, $text);
}

echo stripSquareTags($text);
?>

PHP有它的bbcodes自己的功能- http://php.net/manual/bg/function.bbcode-create.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM