0

I have a variable $date containing the date such as "12 2,2016" and i want to convert this date into following format. February 12,2016. how is this possible in php ?

usman khalid
  • 75
  • 3
  • 14

2 Answers2

0
$date=date_create("2016-02-12");  
echo date_format($date,"M d, y"); 

result: Feb 12, 2016

0

try it

    $date=date_create("12-2-2016");
    echo date_format($date,"F d, Y"); 
Amit Chauhan
  • 682
  • 7
  • 22