PHP considers null is equal to zero

前端 未结 11 2078
眼角桃花
眼角桃花 2020-12-05 12:50

In php, ($myvariable==0) When $myvariable is zero, the value of the expression is true; when $myvariable is null, the value of this expression is also true. How

11条回答
  •  广开言路
    2020-12-05 13:12

    Use the php function is_null( ) function along with the === operator. !== also works the way you'd expect.

提交回复
热议问题