Jump to content

XML parser


mithu_sree

Recommended Posts

[code]
<?php
function parse_xml_file(){
global $xml_file, $vals, $index;
$xml_parser = xml_parser_create();

if (!($fp = fopen($xml_file, "r"))) {
die("could not open XML input");
}
$data = fread($fp, filesize($xml_file));
fclose($fp);
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
}
?>
[/code]



the inpur xml file contains
<?xml ..?>
<tagA>
<t1>
...
</t1>
<t2>
....
</t2>
</tagA>

<tagB>
<t3>....
</t3>
</tagB>


And The parser stoped after </tagA>
What shoud I do to entair tags get parsed?
Link to comment
https://forums.phpfreaks.com/topic/33057-xml-parser/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.