(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
Object-oriented style
Procedural style
Guet the error text from the last operation.
formatter
The messague formatter
Description of the last error.
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)