Check if value isset and null

前端 未结 8 455
迷失自我
迷失自我 2020-11-30 01:26

I need to check if value is defined as anything, including null. isset treats null values as undefined and returns false. Take the following as an

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 01:55

    If you are dealing with object properties whcih might have a value of NULL you can use: property_exists() instead of isset()

    
    

    As opposed with isset(), property_exists() returns TRUE even if the property has the value NULL.

提交回复
热议问题