开发者

saving html tags and reproducing properly

I am using mysql db and PHP code.

I store value like this in db <u><strike>&开发者_如何学Pythonlt;i><b>Opinion</b></i></strike></u>

that is with some editor. so how do I display it so that, it takes all the tags given to it?


You should always use htmlspecialchars() function when filling form values.
As well as textarea content.
It will preserve all your tags as is.

$text = htmlspecialchars($text);
echo "<textarea>$text</textarea>";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜