What's the difference between if(!$variable) and if(isset($variable))?

前端 未结 3 1330
一个人的身影
一个人的身影 2020-12-06 11:16

What is the difference between if(!$variable) and if(isset($variable))?

3条回答
  •  醉梦人生
    2020-12-06 12:00

    They are two different statements

    1. in the first you check if a variable is false hence the '!'
    2. here you check if a variable is actually set to some value other then null.

提交回复
热议问题