+ 2
Could anyone tell me why we use isset() method in php
5 Answers
+ 1
I think it's to check if a variable is set, for example.
+ 1
<?php
$var = ""; // variable set
if (isset($var))
echo "it's true because the variable is set";
?>
you can also compare:
if(isset($var) == ""){
echo "empty";
} else {
echo "not empty";
}
As I sad, the isset() method is to check if a variable IS SET.
+ 1
got itđ
0
like????
0
To check if variable is set.