title: Find past week, 2 days ago, yesterday and today with a PHP date
body: <p>I am trying to use the chartist JS script in order to fill up a chart.
  My need is to show entries all the way back til past week. But I'd like to separate them in "Past Week, 2 Days Ago, Yesterday and Today".</p>
  
  <p>As I get all the entries from the database, there is a field that contains a datetime, I'd like to find a flexible way to compare against it for each above case and show the entries or not.</p>
  
  <p>Tried something like,</p>
  
  <pre><code>$entrydate = explode(' ', $entry['datetime'])[0];
  
  if (date('Y-m-d', strtotime('-7 days', strtotime($entrydate)))) {
      echo 'past week';
  } else if (date('Y-m-d', strtotime('-2 days', strtotime($entrydate)))) {
      echo '2 days ago';
  } else if (date('Y-m-d', strtotime('-1 days', strtotime($entrydate)))) {
      echo 'yesterday';
  } else {
      echo 'today'; //...
  }
  </code></pre>
  
  <p>but didn't work.</p>