Hello
I have recently been trying to parse an XML document that has different
content in the same tags. Here is an example:
<LIST_ITEM>1</LIST_ITEM>
<LIST_ITEM>2</LIST_ITEM>
<LIST_ITEM>3</LIST_ITEM>
...
I am trying to get the content from <LIST_ITEM> into an array. I want the
content of the first <LIST_ITEM> to go into $p->ART_ID[0] and the next to go
into $p->ART_ID[1] and so on. Here is what my Element Content Function looks
like:
-------------------------------------------------------------
function elementContent($parser, $data, $attrs='') {
global $tag, $data, $test;
global $p;
$ti = sizeof( $tag ) - 1;
if ( $tag[$ti] == 'LIST_ITEM' ) {
$p->ART_ID[] .= $data;
}
}
------------------------------------------------------------
When I type in echo $p->ART_ID[0] I should get 1 however I get 1 2 3. For
some reason all the content goes only into one section of the array. Does
anyone know how I can fix this?
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php