PHP IF-Statement doesnt work like i want : <p>I recently started writing a website for learning html/css/js/php.</p>

<p>I designed the front-end of my site with bootstrap.
Now I am trying to validate some inputs with PHP.</p>

<p>I tried this:</p>

<pre><code>    if ($durationHH &lt;= 0 &amp;&amp; $durationMM &lt;= 0)
    {
        echo "DurationHH and DurationMM can not be both zero at the same time.";    
        echo "&lt;br&gt;";
        echo "DurationHH and DurationMM can not be smaller than 0.";       
    }
    elseif (empty($durationHH) || empty($durationMM))
    {       
        echo "DurationHH and DurationMM can not be empty.";
        echo "&lt;br&gt;";
    }
    else
    {
        echo $_POST["durationMM"];
        echo ":";
        echo $_POST["durationHH"];
    }
</code></pre>

<p>I tested the validation by putting in some values for durationHH and durationMM.</p>

<p>Everything is working fine so far, except these two cases:</p>

<p>durationMM = 0 AND durationHH = any value</p>

<p>&amp;&amp;</p>

<p>durationHH= 0 AND durationMM = any value.</p>

<p>In these two cases i get the output: "DurationHH and DurationMM can not be empty."</p>

<p>How/why does this happen?</p>
