Simple PHP Code show, How many Days Remain to Holiday

<?php 
$target = mktime(0, 0, 0, 12, 25, 2014);
 //within above bracket you need give (0, 0, 0, Month, Date, Year )
$today = time() ;
$difference =($target-$today) ;
$days =(int) ($difference/86400) ;
print "Holiday is in $days days";
?>

This PHP code automatically count and illustrate how many Days remain to your holiday

click this link to view online how this code works http://codepad.org/Je3RTysF

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s