PHP xml_parser_create() Function

In this chapter you will learn:

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

Description

The xml_parser_create() function creates an XML parser.

Syntax

PHP xml_parser_create() Function has the following syntax.

xml_parser_create(encoding)

Parameter

ParameterIs RequiredDescription
encodingOptional.Output encoding. Default is UTF-8

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


<?php/*from   j  a v a 2 s .  c  o  m*/
$xmlparser = xml_parser_create();

xml_parser_free($xmlparser);
?>

Next chapter...

What you will learn in the next chapter:

  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