free hit counter

Get Days difference between two dates in today, yesterday 2 days ago, in 3 days etc in PHP

Get Days difference between two dates in today, yesterday 2 days ago, in 3 days etc in PHP
Get Days difference between two dates ! Examples of what the function can return; Today Yesterday Tomorrow In 2 days In 6 days 5 days ago Thursday 18 January Tuesday 19 January 2013   <?php       $my_timestamp = “2013-09-01 11:22:47″;   echo relative_date(strtotime($my_timestamp ));      function relative_date($time)   {       $today = strtotime(date(‘M j, Y’));       $reldays = ($time – $today)/86400;       if ($reldays >= 0 && $reldays < 1)       {           return ‘Today’;          } else if ($reldays >= 1 && $reldays < 2) {              return ‘Tomorrow’;          } else if ($reldays >= -1 && $reldays < 0) {              return ‘Yesterday’;       }   ...