PHP xml_parser_get_option() Function
Description
The xml_parser_get_option() function gets options from an XML parser.
Syntax
PHP xml_parser_get_option() Function has the following syntax.
xml_parser_get_option(parser,option,value)
Parameter
Parameter | Is Required | Description |
---|---|---|
parser | Required. | XML parser to use |
option | Required. | option to get. |
Possible values for option:
- XML_OPTION_CASE_FOLDING - Specifies if case-folding is enabled. Enabled by default. Can be 1 (TRUE) or 0 (FALSE)
- XML_OPTION_TARGET_ENCODING - Specifies which target encoding to use in this XML parser. By default, it is set to the same as the xml_parser_create() function. Supported target encodings are ISO-8859-1, US-ASCII and UTF-8.
Return
This function returns the options value on success, or FALSE and an error on failure.
Example
Get options from an XML parser
<?php//w w w. j a va 2s . c om
$xmlparser = xml_parser_create();
echo xml_parser_get_option($xmlparser, XML_OPTION_CASE_FOLDING);
xml_parser_free($xmlparser);
?>