In my mySQL database, I have a DATE value in the format “YYYY-MM-DD”. In my PHP web-page, I retrieve the value from the database and write it to the HTML output. However, I would like to change the formatting of that value.
Example:
"2012-02-01"
I would like to output:
"February 1, 2012"
Is there a built-in PHP-function which can achieve that, or do I have to write my own function for that?
Use
date(),Although it’s probably better to use
mktime()instead ofstrtotime()so that it’s unambiguous,