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

search for in the

IntlDateFormatter::getErrorMessage> <IntlDateFormatter::getDateType
Last updated: Fri, 10 Oct 2008

view this page in

IntlDateFormatter::getErrorCode

datefmt_get_error_code

(No version information available, might be only in CVS)

IntlDateFormatter::getErrorCode -- datefmt_get_error_code直近の操作のエラーコードを取得する

説明

オブジェクト指向型

integer IntlDateFormatter::getErrorCode ( void )

手続き型

integer datefmt_get_error_code ( IntlDateFormatter $fmt )

直近の操作のエラーコードを取得します。 直近の数値フォーマット操作のエラーコードを返します。

パラメータ

fmt

Formatter リソース。

返り値

エラーコードを返します。UErrorCode のいずれかの値となります。初期値は U_ZERO_ERROR です。

例1 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";
}
?>

例2 オブジェクト指向の例

<?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";
}
?>

上の例の出力は以下となります。

         
ERROR: U_ZERO_ERROR (0)


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

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