Use Strtotime to format variables for hour, minute, and AM/PM
php, strtotime
Solution
To echo 16:30:00 from 4, 30 and PM
echo date("H:i:s", strtotime("$hour:$minute $period"));
Problem
I am trying to figure out how to use strtotime with the values below. I think this should be simple but I just can't get it. I would like the output to be something like: date("H:i:s") - which looks like - 16:30:00 ``` <?php $hour = "4"; $minute = "30"; $period = "PM"; echo strtotime("$hour $minute $period") ?> ``` I've been digging around for a while but can't figure this out. Any ideas would be very helpful! Thank you!