Converting JavaScript into PHP code: Is year a leap year?
<p>The function should take a date as its parameter and return <code>true</code> or <code>false</code>. Here is a JavaScript model of what I need:</p>

<pre><code>function isLeapYear(date) {
    var year = date.getFullYear();
    if (year % 4 == 0)
        if ((year % 100 != 0) || (year % 400 == 0))
            return true;
        else
            return false;
    else
        return false;
}
</code></pre>

<p>This is what I have so far, but it isn't working well:</p>

<pre><code>function isLeapYear($date){
    $time = strtotime($date);
    return date('L') ? true : false;
}
</code></pre>
