Easy Tutorial
❮ Php Is_Callable Function Func Math Mt Getrandmax ❯

PHP xml_set_character_data_handler() Function



Definition and Usage

The xml_set_character_data_handler() function sets up a character data handler for an XML parser.

This function specifies the function to be called when the parser encounters character data in the XML file.

It returns TRUE on success and FALSE on failure.

Syntax

Parameter Description
parser Required. Specifies the XML parser to use.
handler Required. Specifies the function to be used as an event handler.

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

Parameter Description
parser Required. Specifies a variable containing the XML parser that called the handler.
data Required. Specifies a variable containing the character data in string form from the XML file.

Tips and Notes

Note: The handler parameter can also be an array containing an object reference and a method name.


Example

XML File

PHP Code

The output of the above code is as follows:


❮ Php Is_Callable Function Func Math Mt Getrandmax ❯