PHP xml_parser_create_ns() Function

In this chapter you will learn:

  1. Description for PHP xml_parser_create_ns() Function
  2. Syntax for PHP xml_parser_create_ns() Function
  3. Parameter for PHP xml_parser_create_ns() Function
  4. Return for PHP xml_parser_create_ns() Function
  5. Example - creates an XML parser with namespace support

Description

The xml_parser_create_ns() function creates an XML parser with namespace support.

Syntax

PHP xml_parser_create_ns() Function has the following syntax.

xml_parser_create_ns(encoding,separator)

Parameter

ParameterIs RequiredDescription
encodingOptional.Output encoding. Default in PHP 5.0.2 and newer is UTF-8
separatorOptional.Output separator for tag name and namespace. Default is " : "

Possible values:

  • ISO-8859-1
  • UTF-8
  • US-ASCII.

Return

This function returns a resource handle to be used by other XML functions on success, or FALSE on failure.

Example

Create an XML parser with namespace support


<?php//from j a v a 2s .co  m
$xmlparser = xml_parser_create_ns();

xml_parser_free($xmlparser);
?>

Next chapter...

What you will learn in the next chapter:

  1. Description for PHP xml_parser_free() Function
  2. Syntax for PHP xml_parser_free() Function
  3. Parameter for PHP xml_parser_free() Function
  4. Return for PHP xml_parser_free() Function
  5. Example - frees an an XML parser