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, 14 Jun 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_codeLit le code d'erreur de la dernière opération

Description

Style orienté objet

int IntlDateFormatter::getErrorCode ( void )

Style procédural

int datefmt_get_error_code ( IntlDateFormatter $fmt )

Lit le code d'erreur de la dernière opération.

Liste de paramètres

fmt

La ressource de formateur IntlDateFormatter.

Valeurs de retour

Le code d'erreur, une des valeurs UErrorCode. La valeur initiale est U_ZERO_ERROR.

Exemples

Exemple #1 Exemple avec datefmt_get_error_code(), procédural

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

Exemple #2 Exemple avec datefmt_get_error_code(), POO

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

L'exemple ci-dessus va afficher :

Erreur : U_ZERO_ERROR (0)

Voir aussi



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