Which function is used to check if a variable has been declared and is not null?

PHP Intermediate Easy

PHP Intermediate — Easy

Which function is used to check if a variable has been declared and is not null?

Key points

  • isset() returns false for null
  • isset() returns true for 0 or false
  • defined() is for constants only

Ready to go further?

Related questions