jmansa;10909668 wrote:or even better... 2009 april 2...
$month_names = array("01" => "January",
"02" => "February",
"03" => "March",
"04" => "April",
"05" => "May",
"06" => "June",
"07" => "July",
"08" => "August",
"09" => "September",
"10" => "October",
"11" => "November",
"12" => "December"
);
$date = "20090402";
$year = substr($date,0,4);
$month = substr($date,4,2);
$day = substr($date,6);
echo $year . " " . $month_names[$month] . " " . $day;
This would produce:
2009 April 02
You can change the months to however you'd like, IE: Jan, Feb, Mar...
This would also work if you used the date data-type as has been recommended.
Cheers!