I have a time \"7:00 am\" that I need to split into $hour, $min, $ampm. Is there an easy way that I can split this in to 3 variables?
$hour
$min
$ampm
$yourtime = "7:00 am"; preg_match("/([0-9]{1,2}):([0-9]{1,2}) ([a-zA-Z]+)/", $yourtime, $match); $hour = $match[1]; $min = $match[2]; $ampm = $match[3];