显示数据时(将特殊符号如空格等转化为html可识别的): $content = html_entity_decode($row['content'], ENT_QUOTES,"UTF-8"); 将提交到的数据存入数据库时(将特殊符号如空格等转化为源代码编码,如空格转为 ): $data['content'] = htmlentities($data['content'] ,ENT_QUOTES, "UTF-8");