/ Published in: PHP
// example
$from = '2011-1-6';
$to = '2011-1-8';
dateDiff($from,$to); // returns 2
$from = '2011-1-6';
$to = '2011-1-8';
dateDiff($from,$to); // returns 2
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function dateDiff($beginDate, $endDate) { return $end_date - $start_date; }
URL: http://www.klovera.com/php-subtract-dates/