📜  php != 运算符 - PHP 代码示例

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

代码示例4
// 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'];
}