PHP filter_has_var () Funktion
Definition und Verwendung
filter_has_var () Funktion überprüft, ob die angegebene Eingangsvariablentyp existiert.
Wenn dies gelingt es TRUE zurück, bei einem Fehler FALSCH.
Grammatik
filter_has_var(type, variable)
参数 | 描述 |
---|---|
type | 必需。规定要检查的类型。 可能的输入类型:
|
variable | 必需。规定要检查的变量。 |
Beispiele
In diesem Beispiel wird die Eingangsgröße "name" auf die PHP-Seite gesendet:
<?php
if(!filter_has_var(INPUT_GET, "name"))
{
echo("Input type does not exist");
}
else
{
echo("Input type exists");
}
?>
if(!filter_has_var(INPUT_GET, "name"))
{
echo("Input type does not exist");
}
else
{
echo("Input type exists");
}
?>
Ausgangscode ist wie folgt:
Input type exists
Komplette PHP Filter Referenz