Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

boolean error_log(string message, integer type, string
destination, string extra_headers)


The error_log function sends an error message to one of four places depending on the
type argument. The four values for the type argument are listed in Table 8.9. An
alternative to error_log is the syslog function.


<?
//send log message via email to root
error_log("The error_log is working", 1, "root", "");
?>


Table 8.9. error_log Message Types

Type Description


0 Depending on the error_log configuration directive, the message is sent either
to the system log or to a file.


1


The message is sent by email to the address specified by the destination
argument. If the extra_headers argument is not empty, it is sent as headers to
the email.

2 The message is sent through the remoargument specifies the host and port separated by a colon.te debugging system. The destination


3 The message is appended to the file specified by the destination argument.^


boolean extension_loaded(string extension)


Use extension_loaded to test for the presence of an extension.


<?
if(extension_loaded("php_mysql.dll"))
{
print("php_mysql.dll is present");
}
else
{
print("php_mysql.dll is not present");
}
?>


value func_get_arg(integer argument)


The func_get_arg function allows you to get by number an argument passed to a
function you write. The first argument will be number zero. This allows you to write
functions that take any number of arguments. The return value might be any type,

Free download pdf