(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
IntlDateFormatter::getErrorMessage -- datefmt_get_error_message — Lee el último mensaje de error
Estilo orientado a objetos
Estilo por procedimientos
Lee el mensaje de error de la última operación.
La descripción del último error.
Ejemplo #1 Ejemplo con datefmt_get_error_message()
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = datefmt_format($fmt);
printf(
"Error : %s (%d)\n",
datefmt_get_error_message($fmt),
datefmt_get_error_code($fmt)
);
?>
Ejemplo #2 Ejemplo orientado a objetos
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = $fmt->format(0);
printf(
"Error : %s (%d)\n",
$fmt->getErrorMessage(),
$fmt->getErrorCode()
);
?>
El resultado del ejemplo sería:
Error : U_ZERO_ERROR (0)