I have a month value (1-12), day value (1-31), and a year value (2010,2011,2012). I also have a hour value and a minute value.
How can I give this to strtotime()>
Given the variables $year
$month
$day
$hour
$minute
you can do:
strtotime("$year-$month-$day $hour:$minute");
Be careful to enclose the variables with "
, never in this case with '
.
UPDATE (thanks to comments of @Clockwork and @Tadeck):
In case there is a variable $timeofday
that represents the time of day (i.e. AM or PM),
then you can parse it this with:
strtotime("$year-$month-$day $hour:$minute$timeofday");
that is to say, just attach that variable to the end of the text.