Definition and usage
The Error_log () function sends an error to the server error record, file, or remote destination.
Returns true if successful, otherwise false is returned.
Grammar
Error_log(error,type,destination,headers)
| Parameters |
Description |
| Error |
Necessary. The error message to log. |
| Type |
Optional. Specifies the type of error record.
Possible record types:
- 0– default. Depending on the error_log configuration in the php.ini file, the error is sent to the server log system or file.
- The-destination error is sent to the address in the parameters. Only this type uses the headers parameter.
- -the error is sent via the PHP debugging connection. This option is only available in PHP 3.
- The 3– error is sent to the file destination string.
|
| Destination |
Optional. Specifies where to send the error message. The value of the parameter depends on the value of the "type" parameter. |
| Headers |
Optional. Used only when "type" is 1.
Specify additional headers, such as from, Cc, and BCC. separated by CRLF (\ r \ n).
Note: When sending an e-mail message, the From header must be included. Can be set in the php.ini file or through this parameter.
|
PHP Error_log () function