PHP 8.3.4 Released!

xml_parser_get_option

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

xml_parser_get_optionObtiene el valor de las opciones de un intérprete XML

Descripción

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

Obtiene el valor de una opción de un intérprete XML.

Parámetros

parser
Identificador del recurso del intéprete XML sobre el que se va a obtener el valor de la opción.
option
Indica cual es la opción para ir a buscar. Estan disponibles XML_OPTION_CASE_FOLDING y XML_OPTION_TARGET_ENCODING. Para su descripción ver xml_parser_set_option() .

Valores devueltos

Devuelve el valor de la opción. Puede devolver false si: parser no se refiere a un intérprete válido o si option no es válido, también generará un E_WARNING en ambos casos.

add a note

User Contributed Notes 1 note

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