English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

Usage and Example of PHP xml_parser_get_option() Function

    PHP XML Function Manual

    The xml_parser_get_option() function is used to obtain options from the XML parser.

Syntax

xml_parser_get_option(parser, option, value)

Definition and Usage

It has obtained options from the XML parser

Return Value

If the parser parameter does not point to a valid parser or the option parameter is invalid, the function will return FALSE (and produce an E_WARNING warning). Otherwise, it will return the value of the specified setting option.

Parameter

Serial NumberParameters and Description
1

parser

Specify the XML parser to be used.

2

option

Specify the option to be obtained. Possible values:
  • XML_OPTION_CASE_FOLDING - Specify whether to allow case-folding. The default is to allow. It can be 1(TRUE) or 0(FALSE).

  • XML_OPTION_TARGET_ENCODING - Specify which target encoding to use in the XML parser. By default, it is the same as the setting of the xml_parser_create() function, and it supports the following target encodings: ISO-8859-1、US-ASCII and UTF-8.

Online Example

Try the following example to get the option setting information from the XML parser

<?php
   $input = xml_parser_create();
   
   echo xml_parser_get_option($input, XML_OPTION_CASE_FOLDING);
   xml_parser_free($input);
?>
Test and see‹/›

Output Result

1

PHP XML Function Manual