Skip to Main Content
XML and PHP
book

XML and PHP

by Vikram Vaswani
June 2002
Intermediate to advanced content levelIntermediate to advanced
384 pages
7h 53m
English
Sams
Content preview from XML and PHP

Handling Errors

During the initial stages of application development, it’s possible to get by without using error handlers in your code; however, as an application is being packaged for release, graceful error handling and recovery becomes a must.

PHP allows developers to accomplish this error handling via its xml_get_error_code() function (which prints the error code returned by the parser when it hits a bump) and its xml_error_string() function, (which returns a short, human-readable error message corresponding to the error code). Table 2.2 is a list of error codes and their corresponding named constants, together with what they mean.

Table 2.2. SAX Parser Error Codes
Error Code Error Constant Meaning
1 XML_ERROR_NO_MEMORY Parser out of memory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PHP Development Tool Essentials

PHP Development Tool Essentials

Chad Russell
PHP Web Services

PHP Web Services

Lorna Jane Mitchell

Publisher Resources

ISBN: 0735712271Purchase book