xml parser get option in PHP

In this article I will explain how the xml_parser_get_option() function can be used in PHP.
  • 2059

xml_parser_get_option() function in PHP

  • The xml_parser_get_option() function is used to get options from an XML parser.
  • The xml_parser_get_option() function returns the options value on success.
  • The xml_parser_get_option() function returns FALSE and an error on failure.

Syntax

xml_parser_get_option(parser,option,value)

Parameter

  • parser parser is required parameter. it is specify for XML parser to use.
  • option option is required parameter. it is specify for option to get. Possible values:
    • XML_OPTION_CASE_FOLDING - It is Specify if case-folding is enabled. it is enabled by default. it can be 1 for TRUE or 0 for FALSE.
    • XML_OPTION_TARGET_ENCODING - It is Specify which target encoding to use in this XML parser. this is the default value.
Example

The following example show to how the xml_parser_get_option() function can be used in PHP.

<html>

<body>

<h3 style="color: darkblue;">xml_parser_get_option() function example in PHP</h3>

    <?php

    $xmlparser = xml_parser_create();

    echo"xml_parser is created with xml_parser_create<br/>";

    echo "Return value by get option is  : ".xml_parser_get_option($xmlparser, XML_OPTION_CASE_FOLDING);

    xml_parser_free($xmlparser);

    echo("<br>Now xml_parser free with xml_parser_free function....!");

    ?>

</body>

</html>

 

Output

xml-parser-get-option-php.gif
You may also want to read these related articles here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2019 DotNetHeaven. All rights reserved.