Created
November 7, 2013 14:55
-
-
Save mikedugan/7355925 to your computer and use it in GitHub Desktop.
general purpose xml reader
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 | |
| //useful in combination with scandir() function and a foreach loop | |
| if (file_exists('test.xml') { | |
| $xml = simplexml_load_file('test.xml'); | |
| $node1 = $xml->node1; | |
| $node2 = $xml->node1->node2; | |
| $n2attr = $node2['someAttr']; | |
| } | |
| else { exit('Failed to open file'); } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment