Printing Information

Often it's necessary to print messages to the output stream from your module, just as print() would be used within a script. PHP offers functions for most generic tasks, such as printing warning messages, generating output for phpinfo(), and so on. The following sections provide more details. Examples of these functions can be found on the CD-ROM.


zend_printf() works like the standard printf(), except that it prints to Zend's output stream.


zend_error() can be used to generate error messages. This function accepts two arguments; the first is the error type (see zend_errors.h) and the second is the error message:

zend_error(E_WARNING, "This function has been called with empty arguments");

Table ...

Get Web Application Development with PHP 4.0 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.