September 2001
Intermediate to advanced
768 pages
32h 45m
English
int xml_get_current_line_number(resource parserID) Gets the current line number for the specified parser.
Returns:
Current line number on success; FALSE on error
Description:
Returns the current line of data that the XML parser is on. This function is useful for determining where a parser error occurred.
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, $xmldata, feof($fp))) { // if parsing fails print the error description ... |
Read now
Unlock full access