是否有与Microsoft SQL';PHP中的s isull()函数


Is there an equivalent to Microsoft SQL's isnull() function in PHP?

在tSQL中有一个很棒的小函数isull(),它接受以下内容:

ISNULL ( check_expression , replacement_value )

我知道PHP中的is_null(),但它不一样。我还缺少其他功能吗?

我可以看到它在类似这样的情况下很有用(假设这里的isull()与tSQL的工作原理相同):

die("Function does not exist" . isnull($_POST['function'], ". No function was specified"));

在PHP中,最接近isnull函数的方法是使用isset和三元运算符:

$val = isset($val) ? $val : $value_if_val_is_null;