html - How to echo all XML within an element in PHP? -



html - How to echo all XML within an element in PHP? -

this question has reply here:

php simplexml innerxml 10 answers

i have piece of xml looks this:

<root> <element>normal,<b>bold</b></element> </root>

how can utilize php echo within <element>, output "normal,<b>bold</b>"?

edit: here code:

<?php $xml = simplexml_load_file('xml_file.xml'); $element = $xml->element; echo $element[1]; ?>

i "normal".

$xml = '<root> <element>normal,<b>bold</b></element> </root>'; $sxe = new simplexmlelement($xml); echo strip_tags($sxe->element->asxml());

you must strip tags when match element.

php html xml

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -