I currently have a script to calculate the difference between two dates, in days:
$now = new DateTime();
$birthday = new DateTime('1973-04-18 09:48:00');
$interval = $now->diff($birthday);
echo $interval->format('%a days');
However, I keep on getting this error:
Fatal error: Call to undefined method DateTime::diff() in /home/test/public_html/age.php on line 4
I found out that this code is only supposed to work with PHP version 5.3, however, is there a workaround for 5.2.17?