Try this cod
$date1='2010/01/01';
$date2='2011/01/02';
$s1=strtotime($date1);
$s2=strtotime($date2);
$difference = abs($s2 - $s1);
echo $difference/(60*60*24);
$date1='2010/01/01';
$date2='2011/01/02';
$s1=strtotime($date1);
$s2=strtotime($date2);
$difference = abs($s2 - $s1);
echo $difference/(60*60*24);