Easy Tutorial
❮ Func String Vprintf Func Mail Mail ❯

PHP xml_parse_into_struct() Function



Definition and Usage

The xml_parse_into_struct() function parses XML data into arrays.

This function parses XML data into two arrays:

The function returns 1 if successful and 0 if it fails.

Syntax

Parameter Description
parser Required. Specifies the XML parser to use.
xml Required. Specifies the XML data to parse.
value_arr Required. Specifies the target array for the XML data.
index_arr Optional. Specifies the target array for the index data.

Tips and Notes

Note: The xml_parse_into_struct() function returns 1 on success and 0 on failure. This is different from TRUE and FALSE, so be cautious when using operators like ===.


Example

XML File

PHP Code

The output of the above code is as follows:


❮ Func String Vprintf Func Mail Mail ❯