<->数据" />
Display results such as:
OK, here's the question, when I enter a general character in the input box, the save to database and the final fetch are removed in input to show no problem.
When the input example "< > this special character, although in the process of PHP acquisition and removal of \ and go to \, but eventually these characters are still to be displayed in input, it will cause the HTML format confusion.
What I do now is to replace the English ' and ' with Chinese ' and ', and then replace it with an escape character when the post is received, such as:
< < 小于号或显示标记> > 大于号或显示标记& & 可用于显示其它特殊字符" " 引号
But always not the best way to ask:
1. What is the best way to handle this?
2. What do you do with an editor such as Kingeditor and FCK?
.
Reply content:
<->数据" />
Display results such as:
OK, here's the question, when I enter a general character in the input box, the save to database and the final fetch are removed in input to show no problem.
When the input example "< > this special character, although in the process of PHP acquisition and removal of \ and go to \, but eventually these characters are still to be displayed in input, it will cause the HTML format confusion.
What I do now is to replace the English ' and ' with Chinese ' and ', and then replace it with an escape character when the post is received, such as:
< < 小于号或显示标记> > 大于号或显示标记& & 可用于显示其它特殊字符" " 引号
But always not the best way to ask:
1. What is the best way to handle this?
2. What do you do with an editor such as Kingeditor and FCK?
.
Escape at output
htmlspecialchars()
Obviously, you shouldn't be escaping like this.
You should turn the double quotes into "
this kind of character.
To knot your own stickers:
1.sql before writing with Addslashes () to the special character multibyte slash
2.sql after removal with tripslashes () to the special character de-slash
3. Use Htmspecialchars () to turn special characters into HTML escape characters when outputting html