- abs: documentation ( source)
- strtotime: documentation ( source)
<?php
// indicate the start date here
$startdate = '2010-01-01';
// indicate the end date here
$enddate = '2011-05-27';
$timestamp_start = strtotime($startdate);
$timestamp_end = strtotime($enddate);
$difference = abs($timestamp_end - $timestamp_start); // that's it!
echo 'Seconds: '.$difference;