downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

IntlDateFormatter::getErrorMessage> <IntlDateFormatter::getDateType
[edit] Last updated: Fri, 17 May 2013

view this page in

IntlDateFormatter::getErrorCode

datefmt_get_error_code

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

IntlDateFormatter::getErrorCode -- datefmt_get_error_codeObtener el código del error de la última operación

Descripción

Estilo orientado a objetos

int IntlDateFormatter::getErrorCode ( void )

Estilo por procedimientos

int datefmt_get_error_code ( IntlDateFormatter $fmt )

Obtiene el código del error de la última operación. Devuelve el código del error de la última operación de formatero de números.

Parámetros

fmt

El recurso del formateador.

Valores devueltos

El código del error, uno de los valores de UErrorCode. El valor inicial es U_ZERO_ERROR.

Ejemplos

Ejemplo #1 Ejemplo de datefmt_get_error_code()

<?php
$fmt 
datefmt_create"en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN  );
$str datefmt_format($fmt);
if(!
$str) {
    echo 
"ERROR: ".datefmt_get_error_message($fmt) . " (" datefmt_get_error_code($fmt) . ")\n";
}
?>

Ejemplo #2 Ejemplo orientado a objetos

<?php
$fmt 
= new IntlDateFormatter"en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN  );
$str $fmt->format();
if(!
$str) {
    echo 
"ERROR: ".$fmt->getErrorMessage() . " (" $fmt->getErrorCode() . ")\n";
}
?>

El resultado del ejemplo sería:

ERROR: U_ZERO_ERROR (0)

Ver también



add a note add a note User Contributed Notes IntlDateFormatter::getErrorCode - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites