xml_parse_into_struct function to determine tag path
Posted: Tue Mar 30, 2004 11:10 am
Hell all,
I'm using xml_parse_into_struct to parse an xml file.
What I want to do is to to get the tag path for each value in the xml file.
this is what i use to get the path
This is working fine but I need to pop the last value in the $tags array when I see type close like this:
This part doesn't work and I keep adding tags to the array and not popping them when one closes.
any ideas?
I'm using xml_parse_into_struct to parse an xml file.
What I want to do is to to get the tag path for each value in the xml file.
this is what i use to get the path
Code: Select all
<?php
if($item['type'] == "open" || $item['type'] == "complete")
array_push($tags, $item['tag']);
?>Code: Select all
<?php
if($item['type'] == "close")
array_pop($tags);
?>any ideas?