相关疑难解决方法(0)

htmlentities破坏utf-8字符串

我在这里发生了一些奇怪的事情,我无法理解为什么,在我的php 5.2.5服务器上(仅在Linux上,Windows php服务器没有同样的问题)当我使用POST表单在包含的输入上发布内容时"é"在另一边我

echo(htmlentities($_POST["myinput"])) 
Run Code Online (Sandbox Code Playgroud)

回声 é

但如果我回应我的

$_POST["myinput"] 
Run Code Online (Sandbox Code Playgroud)

只是它显示"é",所以这意味着我的htmlentities默认不使用UTF-8,我在哪里可以更改htmlentities使用的Charset?

我尝试在我的php.ini default_charset ="UTF-8"中更改它,但它也不起作用?

php

26
推荐指数
2
解决办法
4万
查看次数

标签 统计

php ×1