Jump to content

[SOLVED] how many days until christmas???


djcrisp22

Recommended Posts

 

Dear friends,

 

I am trying to figure out from anyday until christmas?  can anyone help me with the code?  thanks in advance :)  i run this script and it is not working? any help is appreciated. thanks in advance :)

 

 

<?php

//A: RECORDS TODAY'S Date And Time
$today = time();

//B: RECORDS Date And Time OF YOUR EVENT
$event = mktime(0,0,0,12,25,2006);

//C: COMPUTES THE DAYS UNTIL THE EVENT.
$countdown = round(($event - $today)/86400);

//D: DISPLAYS COUNTDOWN UNTIL EVENT
echo "$countown days until Christmas";

?>

Link to comment
https://forums.phpfreaks.com/topic/124420-solved-how-many-days-until-christmas/
Share on other sites

You misspelled $countdown in your echo.

 

<?php

//A: RECORDS TODAY'S Date And Time
$today = time();

//B: RECORDS Date And Time OF YOUR EVENT
$event = mktime(0,0,0,12,25,2008);

//C: COMPUTES THE DAYS UNTIL THE EVENT.
$countdown = round(($event - $today)/86400);

//D: DISPLAYS COUNTDOWN UNTIL EVENT
echo "$countdown days until Christmas";

?>

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.