如何将PHP元素à
和’
转换为默认的utf8字符?解码html特殊字符和其他元素
我尝试html_entity_decode没有成功(我在的地方à
和’
到位的’
显示一些?
)
如何将PHP元素à
和’
转换为默认的utf8字符?解码html特殊字符和其他元素
我尝试html_entity_decode没有成功(我在的地方à
和’
到位的’
显示一些?
)
您有一个编码问题。 html_entity_decode
默认输出iso-8859-1。而你的?
我假设你正在使用utf-8。
试试这个:html_entity_decode('à', ENT_COMPAT, 'utf-8')
html_entity_decode(utf8_decode('’'));
'utf8_decode( '’ ')'不会改变字符串,你的代码是一样的'html_entity_decode(' ’')' - 它不会以这种方式工作。 – Sven
@谢谢了很多 – chokrijobs