略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: xml_parser_get_option

2024-04-24

xml_parser_get_option

(PHP 4, PHP 5, PHP 7, PHP 8)

xml_parser_get_option从 XML 解析器获取选项设置信息

描述

xml_parser_get_option(resource $parser, int $option): mixed

parser
指向要获取设置信息的 XML 解析器的指针。
option
要获取的设置选项名称。可以使用 XML_OPTION_CASE_FOLDINGXML_OPTION_TARGET_ENCODING 常量。其说明见 xml_parser_set_option()

如果 parser 参数没有指向一个合法的解析器或者 option 参数无效,该函数将返回 false(同时产生 E_WARNING 警告)。否则将返回指定设置选项的值。

add a noteadd a note

User Contributed Notes 1 note

up
0
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);
?>

官方地址:https://www.php.net/manual/en/function.xml-parser-get-option.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3