In my php I have 2 optional inputs. `input1=` and `input2=`. Both are optional inputs. My question is how do I determine if an input was just not provided or if the input provided was not a string?

I only want people to put an actual string. Not different types of data structures.

Examples

Valid: `www.example.com/myfile.php?input1=hello&input2=bye`

Valid: `www.example.com/myfile.php?input1=hello`

Valid: `www.example.com/myfile.php?input2=hello`

Valid: `www.example.com/myfile.php`

Invalid: `www.example.com/myfile.php?input1[]`

---

```
<?php

function check_valid($string) {
    if (!is_string($string)) {
        echo "This is a not string. We tested: ".$string."<br>";
    } else {
        echo "This is is string. We tested: ".$string."<br>";
    }
}

$input1 = check_valid($_GET['input1']);
$input2 = check_valid($_GET['input2']);
?>

```