Php 磅符号Simplexml\u加载\u字符串问题

Php 磅符号Simplexml\u加载\u字符串问题,php,mysql,utf-8,simplexml,Php,Mysql,Utf 8,Simplexml,我有一个php脚本,它使用以下代码对xml文件进行分级,然后将其输入mysql数据库 除了上面显示的所有英镑符号外,它工作得非常好 xml编码为utf-8 $xml = file_get_contents('test.xml'); $params = json_decode(json_encode(simplexml_load_string($xml)), 1); //DETAILS TO INSERT $contact_url = $params['contact_url']; etc

我有一个php脚本,它使用以下代码对xml文件进行分级,然后将其输入mysql数据库

除了上面显示的所有英镑符号外,它工作得非常好

xml编码为utf-8

$xml = file_get_contents('test.xml');
$params = json_decode(json_encode(simplexml_load_string($xml)), 1);

//DETAILS TO INSERT
$contact_url = $params['contact_url']; 

etc
有人知道为什么会这样吗


谢谢

在UTF-8中,磅符号是0xC2 0xA3;错误消息中报告的字节为ISO-8859-1字符:

[英镑符号][7][0][0]


因此,我认为您的文档实际上被编码为iso-8859-1,尽管声明中指明了utf-8。

谢谢您的支持-我已经仔细检查了xml,它肯定是utf-8