运行 ❯
获取您
自己的 PHP
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>The === Operator</h1> <p>Compare two variables to check if they are identical.</p> <p>The identical operator (===) checks the value and the data type, unlike the equal operator (==) that checks only the value.</p> <?php $x = 100; $y = 100; if ($x === $y) { echo "$x is identical to $y"; } ?> </body> </html>
=== 操作符
比较两个变量,检查它们是否完全相同。
恒等操作符 (===) 会同时检查值和数据类型,而等于操作符 (==) 只检查值。
100 与 100 完全相同