September 2001
Intermediate to advanced
768 pages
32h 45m
English
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:
// 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, ... |
Read now
Unlock full access