Easy Tutorial
❮ Func String Sscanf Func String Str Rot13 ❯

PHP xml_set_element_handler() Function



Definition and Usage

The xml_set_element_handler() function specifies functions to be called when an element starts and ends in an XML document.

It returns TRUE on success and FALSE on failure.

Syntax

Parameter Description
parser Required. Specifies the XML parser to use.
start Required. Specifies the function to be called at the start of an element.
end Required. Specifies the function to be called at the end of an element.

The function specified by the "start" parameter must have three parameters:

Parameter Description
parser Required. Specifies a variable containing the XML parser that calls the handler.
name Required. Specifies a variable containing the name of the element (as a string) in the XML file that triggers the function.
data Required. Specifies an array containing the attributes of the element (as strings) in the XML file.

The function specified by the "end" parameter must have two parameters:

Parameter Description
parser Required. Specifies a variable containing the XML parser that calls the handler.
name Required. Specifies a variable containing the name of the element (as a string) in the XML file that triggers the function.

Tips and Notes

Note: The start and end parameters can be an array containing an object reference and method name.


Example

The output of the above code is as follows:


❮ Func String Sscanf Func String Str Rot13 ❯