You might find this Composer package useful for converting Japanese years (Wareki) to Gregorian in PHP:
https://github.com/smensulaiman/japanese-year-converter
It supports both Kanji and Romaji era names (like 平成, 昭和, Reiwa, etc.) and is easy to use with Composer.