xml_parser_get_option
(PHP 4, PHP 5, PHP 7, PHP 8)
xml_parser_get_option — 从 XML 解析器获取选项设置信息
描述
-
parser
- 指向要获取设置信息的 XML 解析器的指针。
-
option
-
要获取的设置选项名称。可以使用
XML_OPTION_CASE_FOLDING
和XML_OPTION_TARGET_ENCODING
常量。其说明见 xml_parser_set_option()。
如果 parser
参数没有指向一个合法的解析器或者
option
参数无效,该函数将返回 false
(同时产生
E_WARNING
警告)。否则将返回指定设置选项的值。

User Contributed Notes 1 note
dnricky at hotmail dot com ¶
4 years ago
<?php
$xmlparser = xml_parser_create();
echo "XML_OPTION_CASE_FOLDING:" . xml_parser_get_option($xmlparser, XML_OPTION_CASE_FOLDING) . "<br />"; //Specifies if case-folding is enabled. Enabled by default. Can be 1 (TRUE) or 0 (FALSE)
echo "XML_OPTION_TARGET_ENCODING:" . xml_parser_get_option($xmlparser, XML_OPTION_TARGET_ENCODING ) . "<br />"; //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.
xml_parser_free($xmlparser);
?>
备份地址:http://www.lvesu.com/blog/php/function.xml-parser-get-option.php