日期:2014-05-17 浏览次数:20427 次
$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');
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