PHP xml_parse_into_struct() Function

PHP XML Parser Reference : Parse XML data into an array (from note.xml)

Definition and Usage

The xml_parse_into_struct() function parses XML data into an array.

This function parses the XML data into 2 arrays:

  • Value array - containing the data from the parsed XML
  • Index array - containing pointers to the location of the values in the Value array
  • Syntax

    xml_parse_into_struct(parser, data, values, index)

    Parameter Values

    Parameter Description
    parser Required. Specifies the XML parser to use
    data Required. Specifies the XML data to parse
    values Required. Specifies an array with the values of the XML data
    index Optional. Specifies an array with pointers to the location of the values in values

    Technical Details

    Return Value: 1 on success. 0 on failure
    PHP Version: 4.0+

    ❮ PHP XML Parser Reference