php[tek] 2018 : Call for Speakers

xml_parser_get_option

(PHP 4, PHP 5, PHP 7)

xml_parser_get_optionGet options from an XML parser

Beschreibung

mixed xml_parser_get_option ( resource $parser , int $option )

Gets an option value from an XML parser.

Parameter-Liste

parser
A reference to the XML parser to get an option from.
option
Which option to fetch. XML_OPTION_CASE_FOLDING and XML_OPTION_TARGET_ENCODING are available. See xml_parser_set_option() for their description.

R├╝ckgabewerte

This function returns FALSE if parser does not refer to a valid parser or if option isn't valid (generates also a E_WARNING). Else the option's value is returned.

add a note add a note

User Contributed Notes 1 note

up
0
dnricky at hotmail dot com
4 months 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);
?>
To Top