Software development - programming solutions

Difference between two dates, in days in PHP  
a simple function, return difference between twho dates (PHP4, PHP5)
//return days

function DateDiffDays($data1,$data2)
{
$arr2=explode(".",$data2);
$arr1=explode(".",$data1);

$diff=abs(mktime(0,0,0,$arr2[1],$arr2[0],$arr2[2])-mktime(0,0,0,$arr1[1],$arr1[0],$arr1[2]))/(86400);
$diff=round($diff);

return $diff;
}

© 1999 - 2024 (site) © 2010 - 2024 (page) Dan Mihaiu, Europe, Romania
Privacy policy   Main site