PHP: write out year if it's not from the current year, timestamp
<p>I wish to only write out(Y) the year, if only its not from the current year we're on.</p>

<pre><code>function get_day_name($timestamp) {
    $date = date('j-m-Y', $timestamp);
    if($date == date('j-m-Y')) {
      $day_name = 'Today';
      echo 'idag ';
    } else if($date == date('j-m-Y',time() - (24 * 60 * 60))) {
      $day_name = 'Yesterday';
      echo 'igår ';
    }else{
    # How can i check here whether the $timestamp is from this year or last year?
    # If it is from this year then it shouldnt write out the "Y" in $date
    echo $date;
    }
}
</code></pre>
