PHP Class JpnForPhp\Converter\Converter

Author: Matthieu Bilbille (@mbibille)
Author: Axel Bodart (@akeru)
Exibir arquivo Open project: mbilbille/jpnforphp Class Usage Examples

Public Properties

Property Type Description
$mapEras

Public Methods

Method Description
toJapaneseNumeral ( integer $number, integer $type = self::NUMERAL_KANJI ) : string Converts a number in Arabic/Western format into Japanese numeral.
toJapaneseYear ( $year, integer $yearType = self::YEAR_KANJI, integer $numeralType = null ) : string Converts a year in Western format into Japanese format.
toWesternYear ( $year ) : string | array Converts a year in Japanese format into Western format.

Method Details

toJapaneseNumeral() public static method

Converts a number in Arabic/Western format into Japanese numeral.
public static toJapaneseNumeral ( integer $number, integer $type = self::NUMERAL_KANJI ) : string
$number integer The input number.
$type integer
return string The Japanese numeral.

toJapaneseYear() public static method

Converts a year in Western format into Japanese format.
public static toJapaneseYear ( $year, integer $yearType = self::YEAR_KANJI, integer $numeralType = null ) : string
$year
$yearType integer : era name output format (kanji, kana, romaji)
$numeralType integer : the numeral type used
return string The Japanese year.

toWesternYear() public static method

Converts a year in Japanese format into Western format.
public static toWesternYear ( $year ) : string | array
$year : kanji or hiragana era name followed by digits, or era name in romaji, space and digit. I.e. : 明治33, めいじ33, Meiji 33
return string | array : The year(s) in Western format.

Property Details

$mapEras public_oe static_oe property

public static $mapEras