0
$id_subramura1=$row['id_subramura1'];
   
  $display_block.="<li><a href=\"".$_SERVER["PHP_SELF"]."?id_subramura1="
  .$id_subramura1."\">".$Denumire_Subramura1."</a></strong></li>";
        
        
      
 print_r($_GET);
 if($_GET["id_subramura1"] === "") echo "a is an empty string\n";
 if($_GET["id_subramura1"] === false) echo "a is false\n";
 if($_GET["id_subramura1"] === null) echo "a is null\n";
 if(isset($_GET["id_subramura1"])) echo "a is set\n";
 if(!empty($_GET["id_subramura1"])) echo "a is not empty";

How it possible to echo "a is null" when is null and nothing when it not null?
AND THE URL SHOW: http://localhost/prajituri/prima.php?id_subramura1=9

Edited by cristi08: complete

2
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by zizuno
0
if(!isset($variable)) echo 'null';
or
if($variable) echo 'null';

Becareful using the second though, if the variable has a value of zero it will say null.

Edited by zizuno: n/a

0

I just showed you.... If it is null, it will echo null. If it is not null, it won't echo anything.

0

I just showed you.... If it is null, it will echo null. If it is not null, it won't echo anything.

:) Your are right but this is my true problem. Even if the url has the get he is not showing me the content of the get like it empty but it not

0
if(!isset($variable)) {
echo 'null';
} else {
echo $variable;
}

just echo the variable.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.