我试图在使用 simplexml_load_string 时获取节点的值。我得到节点的值很好,但由于某种原因,标签中包含的锚标签被完全剥离,并且没有显示出来。
这是xml:
<MessageAfterVoting>Thanks for voting! Here is a link to a page: <a href="/poll/result.html" >clickhere</a></MessageAfterVoting>
当我使用 simplexml_load_string 访问此节点时(MessageAfterVoting)。我只得到文字
Thanks for voting! Here is a link to a page:
我这样调用 simplexml_load_string :
$PresentationContent = simplexml_load_string($pollXML);
有人对解决方法有任何想法吗?最好不要使用 CDATA?