0

In my current month variable have = 2019-12 in

<p class="col-md-1"><?php echo $cm['month']; ?></p> 

I want to show DEC 2019

mplungjan
  • 169,008
  • 28
  • 173
  • 236
farhantechno
  • 595
  • 6
  • 15

2 Answers2

3

Use M Y in date() for the format, and strtotime for input date

echo date("M Y", strtotime('2019-12'));
Devsi Odedra
  • 5,244
  • 1
  • 23
  • 37
2

You can use date() function in php

<?php
$date = "2019-12";

echo date("M Y", strtotime($date)); // Output : Dec 2019

?>
Aman Kumar
  • 4,533
  • 3
  • 18
  • 40