XML无法解析&,怎么解决啊
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
$str1 = "http://user.qzone.qq.com/1340477530#!app=2&pos=1300412602";
$xml = '<?xml version="1.0" encoding="utf-8"?>'."\r\n";
$xml .= '<user>'."\r\n";
$xml .= "\t".'<person_siteurl>'.$str1.'</person_siteurl>'."\r\n";
$xml .= '</user>'."\r\n";
$sxe = new SimpleXMLElement($xml);
$sxe->asXML('test.xml');
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> arning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 3: parser error : EntityRef: expecting ';' in C:\wamp\www\test\a.php on line 18 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <person_siteurl>http://user.qzone.qq.com/1340477530#!app=2\&pos=1300412602</per in C:\wamp\www\test\a.php on line 18
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号