Convert month number to month short name

后端 未结 6 803
无人及你
无人及你 2020-12-11 16:26

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

6条回答
  •  一个人的身影
    2020-12-11 16:45

    Append "01" and strtotime will be able to parse the string :

    echo date('M', strtotime($month . '01'));
    

提交回复
热议问题