I have a value
$month = 1;
It's 1-12. I'd like to convert it to a month name, say $month=1 echo "January";
It's not a date, just a numeric value.
I also have an array that I can access. Shall I use that of is there an easier way?
$months = array("1" => "January", "2" => "February", "3" => "March", "4" => "April", "5" => "May", "6" => "June", "7" => "July", "8" => "August", "9" => "September", "10" => "October", "11" => "November", "12" => "December");
If I need to use the array is it something like:
foreach ($months as $key => $value)
{
if ($key == $month) {
echo $value;
}
}
😕