Checking Whether a Variable is Set and Not Null in PHP


Use isset() to check if a variable has been set and is not null.

Source Code

$var = '';
if (isset($var)) {
    echo "Variable is set.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments