<?
$a=TRUE; //定义逻辑变量真
$b=FALSE; //定义逻辑变量假
if($a and $b) echo "这里为假 1!"; //求与
echo "<br>";
if($a or $b) echo "这里为真 1!"; //求或
echo "<br>";
if($a xor $b) echo "这里为真 2!"; //求异或
echo "<br>";
if(!$a) echo "这里为假 2!"; //求非
?>
(expr1)?(expr2)expr3)
<?
$name = "李";
$newName = ($name == "李"?"李阳":"天涯");
echo $newName
?>
<?
$a= 8*4+6%5; //语句 1
echo $a."<br>";
$a =true?0:true?1:2; //语句 2
echo $a."<br>";
$a=1;
$b=2;
$a-=$b+=3*$b+$a; //语句 3
echo $a.",".$b."<br>";
?>