xml_parse

int xml_parse(resource parserID, string xmldata, [int endofdata]) 
parserID Reference to a valid parser
xmldata XML data to be parsed
endofdata Whether xmldata is the last input to be passed

Parses XML data while firing events for the specified XML parser.

Returns:

TRUE on success; FALSE on failure

Description:

xmldata can be parsed in chunks, but endofdata must be set to TRUE when the last chunk of data is parsed.

Version:

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

Example:

Parse an XML document
 // an invalid XML document $xmlfile = 'myxmlfile.xml'; $xmlparser = xml_parser_create(); // open a file and read data from it for parsing $fp = fopen($xmlfile, 'r'); while ($xmldata = fread($fp, 4096)) { // parse the data chunk if (!xml_parse($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.