I have a variable with the following value
$month = 201002;
the first 4 numbers represent the year, and the last 2 numbers represent the m
You can use the DateTime Class to get a Date data structure using date string and format. Then get a date string with any format like this:
$month = 201002; $date = DateTime::createFromFormat('Yd', $month); $monthName = $date->format('M'); // will get Month name