title: PHP: producing relative date/time from timestamps
body: <p>I'm basically trying to convert a Unix timestamp (the time() function) to a relative date/time that's both compatible with past and future date. So outputs could be:</p>
  <blockquote>
  <p>2 weeks ago</p>
  <p>1 hour and 60 minutes ago</p>
  <p>15 minutes and 54 seconds ago</p>
  <p>after 10 minutes and 15 seconds</p>
  </blockquote>
  <p>First I tried to code this, but made a huge unmaintainable function, and then I searched the internet for a couple of hours, yet all I can find are scripts that produce only one part of the time (e.h: &quot;1 hour ago&quot; without the minutes).</p>
  <p>Do you have a script that already does this?</p>