📜  localhost 比较 operator.php 代码示例

📅  最后修改于: 2022-03-11 14:53:57.535000             🧑  作者: Mango

代码示例5
// Example usage for: Ternary Operator
$action = $_POST['action'] ?: 'default';

// The above is identical to this if/else statement
if (empty($_POST['action'])) {
    $action = 'default';
} else {
    $action = $_POST['action'];
}