xml parser create ns in PHP

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

xml_parser_create_ns() function in PHP

  • The xml_parser_create_ns() function is used to create an new XML parser with namespace support.
  • The xml_parser_create_ns() function returns a resource handle to be used by other XML functions on success..
  • The xml_parser_create_ns() function returns FALSE on failure.

Syntax

xml_parser_create_ns(encoding,separator)

Parameter

  • encoding encoding is required parameter. it is specify for the output encoding. This is the default value. Possible values:
    • ISO-8859-1
    • UTF-8
    • US-ASCII
  • separator separator is optional parameter. it is specify for the output separator for tag name and namespace. Default value of separator is " : ".
Example

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

<html>

<body>

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

    <?php

    $xmlparser = xml_parser_create_ns();

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

    xml_parser_free($xmlparser);

    echo("Now xml_parser free....!");

    ?>

</body>

</html>

 

Output

xml-parser-create-ns-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.