When I use ternary operator in PHP I realize that
0, '0',and null is null
so this is little strange, in my opinion that this value '0' considered as a string and no longer considered as null, but the result in ternary this will return to null
value
maybe this will be help you
$a=0
$b='0'
$c=null
$a??'it is null'
//it is null
$b??'it is null'
//it is null
$c??'it is null'
//it is null
$a==null?'it is null':'not null'
//it is null
$b==null?'it is null':'not null'
//it is null
$c==null?'it is null':'not null'
//it is null
so what I want to ask is, how can I make that '0' is not a null value in ternary PHP