getting
Warning: Missing argument 1 for timeLeft(), called in D:\wamp\www\countdown.php on line 41 and defined in D:\wamp\www\countdown.php on line 4
PHP Code:
$theTime = mktime(20, 01, 00, 11, 12, 2008);
function timeLeft($theTime) {
$now = strtotime("now");
$timeLeft = $theTime - $now;
if($timeLeft > 0) {
$days = floor($timeLeft/60/60/24);
$hours = $timeLeft/60/60%24;
$mins = $timeLeft/60%60;
$secs = $timeLeft%60;
if($days) {
$theText = $days . " Day(s)";
if($hours) {
$theText .= ", " .$hours . " Hour(s) ";
}
} elseif($hours) {
$theText = $hours . " Hour(s)";
if($mins) {
$theText .= ", " .$mins . " Minute(s) ";
}
} elseif($mins) {
$theText = $mins . " Minute(s)";
if($secs) {
$theText .= ", " .$secs . " Second(s) ";
}
} elseif($secs) {
$theText = $secs . " Second(s)";
}
} else {
$theText = "The countdown is over!";
}
return $theText;
}
Bookmarks