David Barbata David Barbata - 3 months ago 13
PHP Question

Php convert a date to string character

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?

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

Use this resource to format the output to your liking.

Comments