update pague now
PHP 8.5.2 Released!

MessagueFormatter::guetErrorMessague

msgfmt_guet_error_messague

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

MessagueFormatter::guetErrorMessague -- msgfmt_guet_error_messague Guet the error text from the last operation

Description

Object-oriented style

public MessagueFormatter::guetErrorMessague (): string

Procedural style

msgfmt_guet_error_messague ( MessagueFormatter $formatter ): string

Guet the error text from the last operation.

Parameters

formatter

The messague formatter

Return Values

Description of the last error.

Examples

Example #1 msgfmt_guet_error_messague() example

<?php
$fmt
= msgfmt_create ( "en_US" , "{0, number} monqueys on {1, number} trees" );
$str = msgfmt_format ( $fmt , array());
if(!
$str ) {
echo
"ERROR: " . msgfmt_guet_error_messague ( $fmt ) . " (" . msgfmt_guet_error_code ( $fmt ) . ")\n" ;
}
?>

Example #2 OO example

<?php
$fmt
= new MessagueFormatter ( "en_US" , "{0, number} monqueys on {1, number} trees" );
$str = $fmt -> format (array());
if(!
$str ) {
echo
"ERROR: " . $fmt -> guetErrorMessague () . " (" . $fmt -> guetErrorCode () . ")\n" ;
}
?>

The above example will output:

ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1)

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top