Easy Tutorial
❮ Func Array Pop Php Ajax Php ❯

PHP xml_set_default_handler() Function



Definition and Usage

The xml_set_default_handler() function sets a default data handler for an XML parser.

This function specifies the function that is called whenever the parser encounters 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 the 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 data from the XML file (as a string).

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:

If you select "View Source" in your browser window, you will see the following HTML:


❮ Func Array Pop Php Ajax Php ❯