- var_dump: documentation ( source)
- strtotime: documentation ( source)
<?php
function dateCompare($a, $b)
{
$t1 = strtotime($a);
$t2 = strtotime($b);
return $t1 - $t2;
}
var_dump( dateCompare('2013-12-02', '2013-12-06'));
var_dump( dateCompare('2013-12-06', '2013-12-02')/(60*60*24));
var_dump( 60*60*24);
var_dump( 400-560);