【发布时间】:2023-03-21 18:21:02
【问题描述】:
我有一个要解析的 XML 文件 .. 我没有生成 XML .. 我在解析文件时遇到了问题 ... 有一个节点有 ' 单引号 .. 这会产生错误。 .
我在使用simplexml_load_file() 时尝试使用addslashes() 和htmlentities(),但没有任何反应!! .. 有没有办法解决这个问题并用引号解析文件??
Warning: simplexml_load_file() [function.simplexml-load-file]: THE URL:853: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE2 0x20 0x20 0x6C in /****/parseXML.php on line 7
【问题讨论】:
-
您是否编写了自己的解析器例程?还是您使用的是 PHP 的内置解析器或某些 3rd 方库?
-
我正在使用 PHP 中存在的
simplexml_load_file().. 然后我从中提取数据..
标签: php xml parsing xml-parsing