if (empty($var)) { echo "The variable is empty"; }
You can also use not empty, by adding an exclamation mark. if (!empty($var)) { echo "The variable has something stored"; }
if (!empty($var)) { echo "The variable has something stored"; }