SimpleXML access separated text nodes
问题 I have an XML file like the following: ... <MyElement>Introduction:<br /> ... </MyElement> ... Are there any way to return "Introduction:" and the rest after </br> of that element? I am using PHP and SimpleXML. Naively use echo $document->MyElement shows "Introduction:...", which mixed up the Introduction line and the content. 回答1: SimpleXML does not have the concept of text-nodes as you might know it from DOMDocument (see as well with this comparison table). So in PHP the option is that you