[php]empty和isset校验参数时的区别

2020-03-24  本文已影响0人  杨肆月

无传参时,值为null
empty: true
!isset: true

有传参,无传值,(xx=),值为""
empty: true
!isset: false

有传参,传值为0,(xx=0),值为“0” string类型
empty: true
!isset: false

有传参,传值为非0,(xx=abc),值为“abc” string类型
empty: false
!isset: false

上一篇 下一篇

猜你喜欢

热点阅读