Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function print_r2($val)
- {
- echo '<pre>';
- print_r($val);
- echo '</pre>';
- }
- $desc = array();
- $xmlStr = file_get_contents("zitem.xml");
- $p = xml_parser_create();
- xml_parse_into_struct($p, $xmlStr, $vals, $index);
- xml_parser_free($p);
- foreach($vals as $val)
- {
- foreach ($val as $key => $value)
- {
- if ($key == 'attributes')
- {
- foreach ($value as $key2 => $val2)
- {
- if (!in_array($key2, $desc) && $key2 != 'XMLNS')
- {
- array_push($desc, $key2);
- }
- }
- }
- }
- }
- echo "ZItem Attributes: <br/><br/>";
- print_r2($desc);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement