I have the following code for a PHP counter:
date_default_timezone_set ('America / Mexico_City');
function evento()
{
time();
$today = strtotime('today 12:00');
$tomorrow = strtotime('tomorrow 12:00');
$time_now = time();
$timeLeft = ($time_now > $today ? $tomorrow : $today) - $time_now;
return gmdate("H:i:s", $timeLeft);
}
echo evento();
it gives me as a result:
00:07:18
My question and doubt (the question may be too new). How could I do to throw the following?
echo evento();
00 Hours, 07 Minutes, 18 Seconds.
I know that Javascript is possible, but I would like to use PHP for this.
Thanks in advance.