Jump to content

Finding the Name of a Month Based on Number


ShoeLace1291

Recommended Posts

I am trying to convert a number of the month to the name of the month... For example:  12 would convert to December.  What's the best way to do this?

 

Context would be helpful since there's probably more than one "best way".

Context would be helpful since there's probably more than one "best way".

I agree, there is always more than one way to do things. If you don't feel like writing out the names, you could use:

echo date( 'F', mktime( 0, 0, 0, $month_number ) );

Probably not as efficient, but less typing.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.