Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何去除特殊字符
Montréal-Rive-Sud
以上是我从 xml 提要中获得的城市名称。它直接插入我的mysql数据库。现在我想删除这种特殊字符。
看起来您在那里遇到了编码问题,该字符串似乎以 UTF-8 编码并被解释为 ASCII 四次:
Montréal-Rive-Sud Montréal-Rive-Sud Montréal-Rive-Sud Montréal-Rive-Sud
Montréal-Rive-Sud
Montréal-Rive-Sud
Montréal-Rive-Sud
提醒我:
你需要mysql_real_escape_string()
mysql_real_escape_string()
更多信息