Oh Jesus, I've really got my headstuck in this one, maybe I should just go home...
I'm retrieving a row from a table which can have multiple dates stored in fields in the following format '2007-10-03 14:24:00'
The fields would be named Order_Date, Despatch_Date, Packing_Date etc
I want to be able to tidy them with a function I though I was getting close but turns out I'm no where near!!
<?php
$date1 = "2007-10-03 14:24:00" ;
$date2 = "2007-11-04 14:24:00" ;
$date3 = "2007-12-05 14:24:00" ;
function tidythedate() {
global $date1, $date2, $date3 ;
$year = substr($date1, 0,4) ;
$month = substr($dat1, 5,2) ;
$day = substr($date1, 8,2) ;
$convertdate = mktime(0,0,0,$month,$day,$year) ;
$date1 = date("d/m/Y", $convertdate) ;
}
$date1 = tidythedate($date1) ;
$date2 = tidythedate($date2) ;
$date3 = tidythedate($date3) ;
echo "<table>
<tr>
<td>$date1</td>
<td>$date2</td>
<td>$date3</td>
</tr>
</table>" ;
?>
Where did I go wrong?
Many Thanks
Mark