Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 561 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 561 Bytes

Iterators for PHP XMLReader for Ease of Parsing

Change Log:

  • 0.1.0 Initial release.

Example

 $reader = new SimpleXMLReader("simple.xml");
 // or:
 // $reader = new SimpleXMLReader(file_get_contents("simple.xml"));

 foreach($reader as $element) {
 	echo str_repeat("\t", $element->depth), $element->name,  " (", $element->getPath(), ")\n";

 	foreach($element as $childs) {
 		echo str_repeat("\t", $childs->depth), $childs->name,  " (", $childs->getPath(), ")\n";
 	}
 }