-2

I have searched but I could not find out how to convert a date from a character string. For example string date is 18-08-2016 I want to convert 18 August 2016 How can I do?

David Barbata
  • 343
  • 1
  • 3
  • 12

1 Answers1

1
$input = '18-08-2016';
echo strftime('%d %B %Y',strtotime($input));// 18 August 2016

Use this resource to format the output to your liking.

BeetleJuice
  • 39,516
  • 19
  • 105
  • 165