Sep 24, 2013

PHP isset() vs empty() vs is_null()

PHP has different functions which can be used to test the value of a variable. Three useful functions for this are isset(), empty() and is_null(). All these function return a boolean value. If these functions are not used in correct way they can cause unexpected results.
isset() and empty() are often viewed as functions that are opposite, however this is not always true. In this post I will explain the differences between these functions.