PHP code example of tsmsogn / date_japanese_era
1. Go to this page and download the library: Download tsmsogn/date_japanese_era library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tsmsogn / date_japanese_era example snippets
$era = new \Date_Japanese_Era\Date_Japanese_Era(array(2009, 7, 11));
echo $era->name; // 平成
echo $era->gengou; // name のエイリアス
echo $era->year; // 21
echo $era->nameAscii; // heisei
$era = new \Date_Japanese_Era\Date_Japanese_Era(array('平成', 21));
echo $era->gregorianYear; // 2009