运行 ❯
获取您
自己的 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>
异或运算符
如果只有一个条件为真,则写一条消息;但如果两个条件都为真,则不写消息。
你好,世界!