富文本编辑器内容会包含很多字符(如: ",',<,>),所以我们在存取的时候必须将他们转义.
存入
/*把预定义的字符 "<" (小于)和 ">" (大于)转换为 HTML 实体:
例: 转换前: $str = "This is some <b>bold</b> text.";
echo htmlspecialchars($str);
转换后: This is some <b>bold</b> text.
*/
内置函数: htmlspecialchars()
取出
/*把 HTML 实体转换为字符:
例: 转换前: $str = "<© W3CSçh°°¦§>";
echo html_entity_decode($str);
转换后: <© W3CSçh°°¦§>
*/
内置函数: html_entity_decode()
作者在用的富文本编辑器 HandyEditor