peb_error

peb_errorReturns the text of the error message from previous peb operation

Description

string peb_error ()

Returns the error text from the last peb function. Note that this function only returns the error text from the most recently executed peb function (not including peb_error() and peb_errno()), so if you want to use it, make sure you check the value before calling another peb function.

Parameters

None

Return Values

Returns the error text from the last peb function, or '' (empty string) if no error occurred.

Examples

Example #1 peb_error() example

<?php
$link 
peb_connect('node@host.domain' 'secret_cookie');
if (!
$link) {
    die(
'Could not connect: ['  peb_errno() ']'  peb_error() );
}
echo 
'Connected successfully';
peb_close($link);
?>

The above example will output something similar to:

Could not connect: [2] ei_connect error

See Also