Convert month number to month short name

Posted by Roland on Stack Overflow See other posts from Stack Overflow or by Roland
Published on 2010-05-31T11:48:13Z Indexed on 2010/05/31 11:52 UTC
Read the original article Hit count: 222

Filed under:

I have a variable with the following value

$month = 201002; 

the first 4 numbers represent the year, and the last 2 numbers represent the month. I need to get the last 2 numbers in the month string name eg. Feb

My code looks like this

<?php echo date('M',substr($month,4,6)); ?>

I can I go about to obtain the month name

© Stack Overflow or respective owner

Related posts about php