I want determine how much is the past has been of days, months and years from a date identifies. Unfortunately, my server does not support the php v.5.3, it only supported php v.5.2. i have code in php v.5.3, what can use it in php v.5.2: What do i do?
<?php
$new_date = '2010/7/11';
$then = DateTime::createFromFormat("Y/m/d",$new_date);
$diff = $then->diff(new DateTime());
$year_d = $diff->format("%y");
$month_d = $diff->format("%m");
$day_d = $diff->format("%d");
echo $year_d .' - ' . $month_d .' - ' . $day_d; //OutPut: 2 - 1 - 21