I am trying to do a little bit of math using dates in PHP. I am modifying a shoutbox, and I want to implement the following functionality.
If post date = today, return time of post
else if date = yesterday, return "yesterday"
else date = X days ago
How would I use php's date functions to calculate how many days ago a timestamp is (the timestamp is formatted in UNIX time)