can anyone explain why the following code
function convdate($date) {
$formatdate = strtoupper(date('M', $date ));
$formatdate .= " " .date('d',$date). " ";
return $formatdate;
}
$sql = "SELECT * FROM livedates ORDER by date";
$res = mysql_query($sql);
while($livedates = mysql_fetch_array($res)){
$output= convdate($livedates['date']) . "<br>";
echo $output;
}
Outputs :
DEC 31
DEC 31
DEC 31
when if i just output the date from the resultset using
$output= $livedates['date']. "<br>";
I get
2013-08-03
2013-08-10
2013-12-09
What I want to be getting is
AUG 03
AUG 10
DEC 09
Its going to be a mistake on my part , I realise that but i'm stumped !