- abs: documentation ( source)
- round: documentation ( source)
- strtotime: documentation ( source)
<?php
$fromDate="2013-03-03";
$toDate="2013-03-05";
$fromDate = strtotime($fromDate);
$toDate = strtotime($toDate);
$diffDate = abs($toDate - $fromDate);
echo $diffDateLast = round($diffDate / (60 * 60 * 24));