Пример #1
0
function OkBad($success = false)
{
    if ($success) {
        return 'Successful';
    } else {
        return 'Failed with this error: ' . print_r(i5_error(), true);
    }
}
Пример #2
0
/**
 * Returns error message or code for most recent action.
 * @return string  Message equivalent to index 2 or 'msg' from i5_error()
 *                 It's often a CPF code.
 *                 Blank if no error
 */
function i5_errormsg()
{
    $errArray = i5_error();
    // return error number if it exists, otherwise an 'OK'.
    return isset($errArray['msg']) ? $errArray['msg'] : I5_ERR_OK;
}