xml_parse_into_struct

PHP 4, PHP 5, PHP 7, PHP 8
xml_parse_into_struct - Parse XML data into an array structure
Manual
Code Examples

xml_parse_into_struct( XMLParser$parser, string$data, arrayvalues, [arrayindex = null] ): int

This function parses an XML string into 2 parallel array structures, one (index) containing pointers to the location of the appropriate values in the values array. These last two parameters must be passed by reference.

Parameters

parser

A reference to the XML parser.

data

A string containing the XML data.

values

An array containing the values of the XML data

index

An array containing pointers to the location of the appropriate values in the $values.

Return Values

xml_parse_into_struct returns 0 for failure and 1 for success. This is not the same as false and true, be careful with operators such as ===.

Changelog

Version Description
8.0.0 parser expects an XMLParser instance now; previously, a resource was expected.

Example of xml_parse_into_struct

Show all examples for xml_parse_into_struct

PHP Version: