Convert month number to month short name

后端 未结 6 790
无人及你
无人及你 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:42

    This may help you..

      $month = substr($month, -2, 2);
      echo date('M', strtotime(date('Y-'. $month .'-d'))); 
    

提交回复
热议问题