xml_get_current_column_number

int xml_get_current_column_number(resource parserID) 

Gets the current column number for the specified parser.

Returns:

Column number on success; FALSE on error

Description:

Returns the current column number for the current line of data that the XML parser is on. To determine the current line, use xml_get_current_line_number(). This function is useful for determining where the parser failed.

Version:

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

Example:

Get the current column number on a parse error
 // 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 ...

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.