php Programming Glossary: simplexmliterator
XML parsing using but Element Names are Dynamic http://stackoverflow.com/questions/13221155/xml-parsing-using-but-element-names-are-dynamic are used in an XML string with SimpleXML you can use the SimpleXMLIterator tagnames array_keys iterator_to_array new RecursiveIteratorIterator.. iterator_to_array new RecursiveIteratorIterator new SimpleXMLIterator string RecursiveIteratorIterator SELF_FIRST print_r tagnames.. more dependend ti_pid_20642 root Combined with the update SimpleXMLIterator above the following example code demonstrates the new behavior..
Extracting data form XML file with SimpleXML in PHP http://stackoverflow.com/questions/2578469/extracting-data-form-xml-file-with-simplexml-in-php an arbitrary nested XML structure you can also use the SimpleXMLIterator e.g. with xml being the string you gave sxi new RecursiveIteratorIterator.. the string you gave sxi new RecursiveIteratorIterator new SimpleXMLIterator xml RecursiveIteratorIterator SELF_FIRST foreach sxi as node..
|