xml_parse_into_struct
Parsing XML data into an array structure
The xml_parse_into_struct()
function parses the XML data into an array.
This function parses XML data into two arrays:
Parses XML data into an array (parsed from note.xml ):
<?php $xmlparser = xml_parser_create ( ) ; $fp = fopen ( "note.xml" , "r" ) ; $xmldata = fread ( $fp , 4096 ) ; // parse XML data into an array xml_parse_into_struct ( $xmlparser , $xmldata , $values ) ; xml_parser_free ( $xmlparser ) ; print_r ( $values ) ; fclose ( $fp ) ; ?>
Run the instance
xml_parse_into_struct ( parser , data , values , index )
parameter | describe |
---|---|
parser | Required. Specifies the XML parser to use. |
data | Required. Specifies the XML data to parse. |
values | Required. Specifies an array to store parsed XML data values. |
index | Optional. Specifies an array that stores a pointer to the data position in the value array. |