簡體   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