Calculate total hours in PHP
Description
The following code shows how to calculate total hours.
Example
<?php//w w w. j av a2s . c o m
$now = mktime();
$taxday = mktime(0,0,0,4,15,2010);
// Difference in seconds
$difference = $taxday - $now;
// Calculate total hours
$hours = round($difference / 60 / 60);
echo "Only $hours hours until tax day!";
?>
The code above generates the following result.