lau*_*kok 7 php xml special-characters html-entities
为什么XML在某些特殊字符上显示错误,有些可以吗?
例如,下面会创建错误,
<?xml version="1.0" standalone="yes"?>
<Customers>
<Customer>
<Name>Löic</Name>
</Customer>
</Customers>
Run Code Online (Sandbox Code Playgroud)
但这没关系,
<?xml version="1.0" standalone="yes"?>
<Customers>
<Customer>
<Name>&</Name>
</Customer>
</Customers>
Run Code Online (Sandbox Code Playgroud)
htmlentities('Löic',ENT_QUOTES)顺便说一下,我通过php转换特殊字符.
我怎么能绕过这个?
谢谢.
编辑:
我发现如果我使用数字字符,它可以正常工作 Lóic
现在我必须找到如何使用PHP将特殊字符转换为数字字符!