The simplest Q ever. $var != 0 in PHP
<p>The example code is ok.</p>

<pre><code>if ($xxx != false) {
    echo 'xxxxxxxxxxx';
} else {
    echo 'aaaaaaaaaaa';
}

// result: xxxxxxxxxxx


if ($xxx !== 0) {
    echo 'xxxxxxxxxxx';
} else {
    echo 'aaaaaaaaaaa';
}

// result: aaaaaaaaaaa
</code></pre>

<p>But this one confuses me </p>

<pre><code>if ($xxx != 0) {
    echo 'xxxxxxxxxxx';
} else {
    echo 'aaaaaaaaaaa';
}
// result: aaaaaaaaaaa
</code></pre>

<p>$xxx is string, why this code returns me false?
I have read the document <a href="http://www.php.net/manual/en/types.comparisons.php" rel="nofollow noreferrer">http://www.php.net/manual/en/types.comparisons.php</a> but still don't understand about it.</p>