PHP xml_parser_get_option()Functions


PHP XML 参考手册Complete PHP XML Reference Manual

Definition and Usage

The xml_parser_get_option() function gets an option from an XML parser.

If successful, the function returns the option value. If it fails, it returns FALSE and an error.

Syntax

xml_parser_get_option(parser,option,value)

Parameters Description
parser Required. Specifies the XML parser to use.
option Required. Specifies the option to retrieve. Possible values:
  • XML_OPTION_CASE_FOLDING - Specifies whether case-folding is allowed. Enabled by default. Can be 1 (TRUE) or 0 (FALSE).
  • XML_OPTION_TARGET_ENCODING - Specifies which target encoding to use in the XML parser. By default, it is the same as the setting of the xml_parser_create() function. The supported target encodings are: ISO-8859-1, US-ASCII, and UTF-8.


Examples

<?php
$xmlparser = xml_parser_create();

echo xml_parser_get_option($xmlparser, XML_OPTION_CASE_FOLDING);

xml_parser_free($xmlparser);
?>


PHP XML 参考手册Complete PHP XML Reference Manual Other Extensions