PHP100 2019-03-27
代码如下:
<?php $a=1;$b=2;$c=3;$d=4; echo $a<$b?'xx':$a<$c?'yy':$a<$d?'zz':'oo'; ?>
代码如下:
$a<$b => true => 'xx' ==> 结束
代码如下:
<?php $a=1;$b=2;$c=3;$d=4; echo (($a<$b?'xx':$a<$c)?'yy':$a<$d)?'zz':'oo'; ?>
代码如下:
$a<$b => true => 'xx' => true => 'yy' => true => 'zz' => 结束
代码如下:
<?php $a=1;$b=2;$c=3;$d=4; echo $a<$b?'xx':($a<$c?'yy':($a<$d?'zz':'oo')); // 括号换下位置就行了, php里括号省不得 ?>
<?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh