PHP htmlentities 引用问题
我很高兴使用重新编码直接输入 SQL 数据库的现有数据库数据,而无需使用 htmlentities。这也是一个法语网站。
我现在尝试将其输出到浏览器,并且通过使用 htmlentities() 所有法语字符都显示良好,但是未编码的 ' 和 ' 给我带来了问题。
我尝试显示的文本的一个示例是:
The ‘Maison de Maître’ is very...
以及显示它的代码
$p_title = htmlentities(stripslashes($pr['title']), ENT_QUOTES);
这不起作用 - 我还尝试使用 UTF-8 作为字符集,这会完全停止标题显示。
任何帮助将不胜感激!
I have the joy of using recoding existing database data that has been entered directly into the SQL database without having htmlentities used. It is also a french website.
I am now trying to output this to the browser and all of the french characters are appearing fine through using htmlentities(), however the unecoded ’ and ‘ are giving me problems.
An example of the text I am trying to display is:
The ‘Maison de Maître’ is very...
And the code to display it
$p_title = htmlentities(stripslashes($pr['title']), ENT_QUOTES);
This does not work - I have also tried using UTF-8 as the charset which stops the title showing at all.
Any help would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以试试这个。它适用于这个特定问题,但我不知道它是否能满足您的所有需要。
$p_title = htmlspecialchars(stripslashes($pr['title']), ENT_QUOTES);
You could try this. It works for this specific problem, but I don't know if it does all that you need.
$p_title = htmlspecialchars(stripslashes($pr['title']), ENT_QUOTES);