In PHP, What is the best way to check whether a string variable is empty or null?
I currently have the following:
if($variable == null || $variable == "")
exit;
And wondered if there was a more minimalistic way of doing this?
Thanks in advance
Use empty() see http://php.net/manual/en/function.empty.php
Empty returns true if the variable is empty or null, full details below
From the doc
The following things are considered to be empty (return true):