&在XML中启动实体。由于您尚未定义实体
&WhateverIsAfterThat,因此会引发错误。您应该使用来逃避它
&。
$string = str_replace('&', '&', $string);如何在XML中转义“&”号
要转义其他保留字符:
function xmlEscape($string) { return str_replace(array('&', '<', '>', ''', '"'), array('&', '<', '>', ''', '"'), $string);}


