三元运算符的细节

// get_type 传 11.11
$get_type1 = (int)$_POST['get_type'] ? $_POST['get_type'] : 1; // 11.11
$get_type2 = (int)$_POST['get_type'] ?  : 1; // 11
echo $get_type1.PHP_EOL;
echo $get_type2.PHP_EOL;
           

三元运算符的细节

猜你喜欢

转载自www.cnblogs.com/jiqing9006/p/11435489.html