public static function getLunarYearName($year) {
$sky = ['庚', '辛', '壬', '癸', '甲', '乙', '丙', '丁', '戊', '己'];
$earth = ['申', '酉', '戌', '亥', '子', '丑', '寅', '卯', '辰', '巳', '午', '未'];
$year = (string)$year;
return $sky[$year{3}] . $earth[$year%12];
}
不支持中括号里的大括号写法.
Array and string offset access syntax with curly braces is deprecated
不支持中括号里的大括号写法.