Contoh penulisan dalam PHP
<?php // nama file : operator_logika.php $x = TRUE; $y = FALSE; echo "<br>Nilai \$x = TRUE"; echo "<br>Nilai \$y = FALSE"; $val = ($x and $y) ? "TRUE" : "FALSE"; echo "<br>Operator logika \$x and \$y = $val"; $val = ($x or $y) ? "TRUE" : "FALSE"; echo "<br>Operator logika \$x or \$y = $val"; $val = ($x xor $y) ? "TRUE" : "FALSE"; echo "<br>Operator logika \$x \xor \$y = $val"; $val = (!$y) ? "TRUE" : "FALSE"; echo "<br>Operator logika !\$y = $val"; ?>
0 Komentar untuk " Operator Logika dalam PHP "