开发者

saving html tags and reproducing properly

开发者 https://www.devze.com 2023-01-05 04:24 出处:网络
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>

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

精彩评论

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