PHP中的比较运算符
<div id="article_content" class="article_content clearfix"><link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-6e43165c0a.css">
<div id="content_views" class="htmledit_views">
<p>比较运算符的计算方</p>
<table><caption>
<strong>比较运算符</strong>
</caption><thead><tr><th>例子</th><th>名称</th><th>结果</th></tr></thead><tbody><tr><td>$a == $b</td><td>等于</td><td><strong><code>true</code></strong>,如果类型转换后 $a 等于 $b。</td></tr><tr><td>$a === $b</td><td>全等</td><td><strong><code>true</code></strong>,如果 $a 等于 $b,并且它们的类型也相同。</td></tr><tr><td>$a != $b</td><td>不等</td><td><strong><code>true</code></strong>,如果类型转换后 $a 不等于 $b。</td></tr><tr><td>$a <> $b</td><td>不等</td><td><strong><code>true</code></strong>,如果类型转换后 $a 不等于 $b。</td></tr><tr><td>$a !== $b</td><td>不全等</td><td><strong><code>true</code></strong>,如果 $a 不等于 $b,或者它们的类型不同。</td></tr><tr><td>$a < $b</td><td>小与</td><td><strong><code>true</code></strong>,如果 $a 严格小于 $b。</td></tr><tr><td>$a > $b</td><td>大于</td><td><strong><code>true</code></strong>,如果 $a 严格大于 $b。</td></tr><tr><td>$a <= $b</td><td>小于等于</td><td><strong><code>true</code></strong>,如果 $a 小于或者等于 $b。</td></tr><tr><td>$a >= $b</td><td>大于等于</td><td><strong><code>true</code></strong>,如果 $a 大于或者等于 $b。</td></tr><tr><td>$a <=> $b</td><td>太空船运算符(组合比较符)</td><td>当$a小于、等于、大于 $b时 分别返回一个小于、等于、大于0的 int 值。</td></tr></tbody></table>
<p></p>
</div>
</div>
<div id="treeSkill"></div>
页:
[1]