執行 ❯
獲取您
自己的 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 完全相同