PHP xml_parser_set_option() Function

bool xml_parser_set_option ( resource $parser , int $option , mixed $value )

The xml_parser_set_option() function sets options in an XML parser.

Sets an option in an XML parser.

xml_parser_set_option — Set options in an XML parser

Example -

Parameters

parser

A reference to the XML parser to set an option in.

option

Which option to set. See below.

The following options are available:

XML parser options
  • XML_OPTION_CASE_FOLDING - Specifies if case-folding is enabled. Enabled by default. Can be 1 (TRUE) or 0 (FALSE)
  • XML_OPTION_SKIP_TAGSTART - Specifies how many characters should be skipped in the beginning of a tag name
  • XML_OPTION_SKIP_WHITE - Specifies whether to skip values consisting of whitespace characters. 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.

This function returns FALSE if parser does not refer to a valid parser, or if the option could not be set. Else the option is set and TRUE is returned.