Ok, So i have a script that reads in a csv file and in there is a time that is formatted in the traditional HH:MM am/pm. I need to convert that into the mysql standard time format (HH:MM:SS).
This is what i have so far and it works
$schedule[$row]["TIME"] = date("H:i:s", strtotime($data[4]))
the problem is, if the input is formatted incorrectly there is no way i can tell. Is there some sort of "or die()" feature i can use or do i have to somehow check with a regex or something?
For example:
12:00 pm should be 12:00:00 but...if theres some issue with the format 12:d00 p.m comes out as 17:00:00
Thanks, Ian