Question: I save the form elements to a file and the following is working as expected.

```
$t_str .= "viewMandatory=".$_GET['viewMandatory'] ."\n";

```

But what I need is that if $\_GET is set only then it should be appended to "t\_str" string. 

If no value for viewMandatory is received from the form, it should print nothing. How to add this check to the above statement?

Answer: 
```
if (!empty($_GET['viewMandatory'])){
$t_str .= "viewMandatory=".$_GET['viewMandatory'] ."\n";
}

```

After 292 questions you should have encountered the empty() function.
```
Use php isset    

if (isset($_GET['viewMandatory'])){
$t_str .= "viewMandatory=".$_GET['viewMandatory'] ."\n";
}

```