Created
July 10, 2014 22:56
-
-
Save quagliato/d066911c17d4cc3f4eed to your computer and use it in GitHub Desktop.
Iterate XMLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$xml = simplexml_load_file("file.xml"); | |
$xmlName = $xml->getName(); | |
foreach ($xml->children() as $child) { | |
foreach ($child->children() as $grandson) { | |
if ($grandson == "tag1") { | |
} | |
if ($grandson == "tag2") { | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment