繁体   English   中英

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

[英]How to remove tags from sceditor textarea result

如果在其中添加一些文本并更改样式并保存到数据库中,则我在网站中使用sceditor。 它存储着诸如sceditor的标签,

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

如何使用php或javascript或jquery删除此标签。

只是尝试与此。

<?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