gianghl1983
6/3/2018 - 6:01 AM

($variable) vs isset($varriable) dieu kien

The difference is that the isset will be true for any variable that has been declared/initalized to anything (besides null). the if($var) is true for all values of var OTHER THAN those that evaluate to false (0, '', null, false, etc).

So the difference is for values that are not null, but still evaluate to false: 0, '' (empty string), false, empty array, etc.

Try this:
$var = '';//or 0 > false
isset($var) {
echo 'a';
}
>>>This case
if ($var) {
echo 'b';
}