PHP Missing Function In Older Version
<p>My this PHP function converts a datetime string into more readable way to represent passed date and time. This is working perfect in PHP version 5.3.0 but on the server side it is PHP version 5.2.17 which lacks this function. Is there a way I can fix this efficiently? This is not only a function which needs this "diff" function but there are many more.</p>

<pre><code>public function ago($dt1)
 {
  $interval = date_create('now')-&gt;diff(date_create($dt1));
  $suffix = ($interval-&gt;invert ? ' ago' : '-');
  if ($v = $interval-&gt;y &gt;= 1) return $this-&gt;pluralize($interval-&gt;y, 'year') . $suffix;
  if ($v = $interval-&gt;m &gt;= 1) return $this-&gt;pluralize($interval-&gt;m, 'month') . $suffix;
  if ($v = $interval-&gt;d &gt;= 1) return $this-&gt;pluralize($interval-&gt;d, 'day') . $suffix;
  if ($v = $interval-&gt;h &gt;= 1) return $this-&gt;pluralize($interval-&gt;h, 'hour') . $suffix;
  if ($v = $interval-&gt;i &gt;= 1) return $this-&gt;pluralize($interval-&gt;i, 'minute') . $suffix;
   return $this-&gt;pluralize($interval-&gt;s, 'second') . $suffix;
 } 
</code></pre>
