Et script til 10 løsninger
Jeg har fundet dette script// enter start date below like this: "January 2, 2001"
$start = "January 29, 2002";
// enter string of what this start date is.
$text = "have passed since I had a fulltime job.";
/*
where you want the time to show up on your page enter this:
include('/HOME/PUBLIC_HTML/PATH_TO_YOUR_FILES/countuptimer.php');
*/
//--------------------------
$now = strtotime ("now");
$then = strtotime ("$start");
$difference = $now - $then ;
$num = $difference/86400;
$days = intval($num);
$num2 = ($num - $days)*24;
$hours = intval($num2);
$num3 = ($num2 - $hours)*60;
$mins = intval($num3);
$num4 = ($num3 - $mins)*60;
$secs = intval($num4);
?>
<p>
<? echo $days ?> days,
<? echo $hours ?> hours,
<? echo $mins ?> minutes,
<? echo $secs ?> seconds
<? echo $text ?>
</p>
Hvordan skal jeg skrive det hvis jeg skal bruge den samme tæller 10 gange på samme side?