djcrisp22 Posted September 16, 2008 Share Posted September 16, 2008 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 More sharing options...
dezkit Posted September 16, 2008 Share Posted September 16, 2008 Uhmm. Link to comment https://forums.phpfreaks.com/topic/124420-solved-how-many-days-until-christmas/#findComment-642531 Share on other sites More sharing options...
dezkit Posted September 16, 2008 Share Posted September 16, 2008 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"; ?> Link to comment https://forums.phpfreaks.com/topic/124420-solved-how-many-days-until-christmas/#findComment-642543 Share on other sites More sharing options...
Garethp Posted September 16, 2008 Share Posted September 16, 2008 Also, change the echo to this echo $countdown . " days until Christmas"; Link to comment https://forums.phpfreaks.com/topic/124420-solved-how-many-days-until-christmas/#findComment-642545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.