Jump to content

Minutes Remaining


ego0

Recommended Posts

i'm not sure i understand the format you're talking of. are the "1158567428" and "1157570931" representative of the times you have? if so, then just try something like this:
[code]
<?php
function getRemainder($time) {
  $now = time();
  $diff = abs($time - $now);
  $res = array(
    'mins' => floor($diff / 3600),
    'secs' => ($diff % 3600)
  );
  return $res;
}

$time = 1158567428; // countdown to
$rem = getRemainder($time);
echo "There are $rem[mins] minutes and $rem[secs] seconds left!";
?>
[/code]

hope this helps
Link to comment
https://forums.phpfreaks.com/topic/19942-minutes-remaining/#findComment-87353
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.