Which function is used to check if a variable is defined and not null?

PHP Intermediate Medium

PHP Intermediate — Medium

Which function is used to check if a variable is defined and not null?

Key points

  • isset() returns false for null values
  • isset() returns true for any non-null value
  • defined() is strictly for constants

Ready to go further?

Related questions