Forum Moderators: coopster
$t["1 AM"] = "01";
$t["2 AM"] = "02";
$t["3 AM"] = "03";
and then simply use:
$newtime = $t[$oldtime];
You could use string split functions and some maths, but it would compile into way more code than doing a conversion table.