I've always used the code below to calculate the difference (in days) between two dates. But I'm wondering if there is something more intelligent, someone knows a better way to do this?
//86400 one day
$data1 = '2013-07-24 21:30:00';
$data2 = '2013-08-24 21:30:00';
$diff = (abs(strtotime($data1) - strtotime($data2))) / 86400;
var_dump($diff);