執行 ❯
獲取您
自己的 PHP
伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>The xor Operator</h1> <p>Write a message if one of the conditions are true, bot not if both conditions are true.</p> <?php $x = 100; $y = 50; if ($x == 100 xor $y == 80) { echo "Hello world!"; } ?> </body> </html>
異或運算子
如果只有一個條件為真,則寫一條訊息;但如果兩個條件都為真,則不寫訊息。
你好,世界!