Q:

Create a simple 'birthday countdown' script, the script will count the number of days between current day and birthday

0

Create a simple 'birthday countdown' script, the script will count the number of days between current day and birthday.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$target_days = mktime(0,0,0,12,31,2013);// modify the birth day 12/31/2013
$today = time();
$diff_days = ($target_days - $today);
$days = (int)($diff_days/86400);
print "Days till next birthday: $days days!"."\n";
?>

Sample Output:

Days till next birthday: -1143 days!

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now