0

I have a date value from database as 12-12-2015
I tried the below code

$date = "12-12-2015";
echo date("M d, Y", strtotime($date));

it gives an output as Dec 12, 2015, but i want December 12, 2015 as output
Thanks on advance

anand
  • 1,559
  • 5
  • 21
  • 45

2 Answers2

4

You are just near to Output. In date format function use F for Full month Display.

$date = "12-12-2015";
echo date("F d, Y", strtotime($date));
Gopalakrishnan
  • 957
  • 8
  • 19
2

Try this:

$date = "12-12-2015";
echo date("F d, Y", strtotime($date));

Reference Link:http://php.net/manual/en/function.date.php

Ajay Makwana
  • 2,330
  • 1
  • 17
  • 32
  • Thanks..If my answer was helpful then accept it by clicking right marker and give up vote. This is the best way to appreciate the answer. – Ajay Makwana Feb 20 '16 at 12:01