xml_parser_create

int xml_parser_create([string encoding]) 

Creates an XML parser and returns its resource.

Returns:

Resource to an XML parser on success; FALSE on error

Description:

This function creates a new XML parser and initializes it for use. A reference to a valid parser needs to be created before parsing is started. Possible encodings are ISO-8859-1 (the default), US-ASCII, and UTF-8. If the parser encounters characters outside its encoding limits, it returns an error. More information on limits of encodings and how encodings are handled can be found in the source file xmlparse.h of this extension.

Version:

PHP 3 >= 3.0.6, PHP 4 >= 4.0b1

Example:

Create an XML parser
 $xmlparser = xml_parser_create(); xml_parser_free($xmlparser);  ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.