I want to convert
令和元年8月 = 2019年8月
Ref https://www.conservapedia.com/Japanese_dates
Here I get these
For this I tried code like below here "平成31年8月" returning 2019 but according to ref it should 令和元年8月 Please suggest me is there any solution so I can set my code like reference..
$formatter = new IntlDateFormatter(
'ja_JP@calendar=japanese',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Europe/Madrid',
IntlDateFormatter::TRADITIONAL,
'Gy年M月'
);
$ts = $formatter->parse('令和元年8月');
//$ts = $formatter->parse('平成31年8月');
var_dump($ts, date('Y-m', $ts));

There seem to be two issues.
平成(Heisei) ended at 2019-04-30, 令和(Reiwa) began at 2019-05-01, so the year-to-year table you referred is not complete if you need to convert specific date in a switching year such like 2019.
For example, both January 平成31 and December 令和1 are AD 2019. So when you only convert year part, they would show the same result.
On my local, "$formatter->parse('令和元年8月');" returned me 1970-01, the Unix epoch time probably coming from null value. This happens because my using PHP yet does not know that Japanese era changed to 令和.
IntlDateFormatter is in pecl php_intl extension, which calls ICU library. ICU library supports the new era name 令和 at its verion 64.2.
You may check your phpinfo() with "ICU version" and if that is smaller than 64.2, it won't convert 令和 properly.
If you can not find 64.2+ on your latest available PHP, you may have to compile intl extension with later ICU library yourself.