función de PHP filter_has_var ()
Definición y Uso
filter_has_var () función comprueba si existe el tipo de variable de entrada especificado.
Si tiene éxito, devuelve TRUE, en caso de error devuelve FALSO.
gramática
filter_has_var(type, variable)
参数 | 描述 |
---|---|
type | 必需。规定要检查的类型。 可能的输入类型:
|
variable | 必需。规定要检查的变量。 |
Ejemplos
En este ejemplo, el "nombre" de entrada variable se envía a la página PHP:
<?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");
}
?>
Código de salida es el siguiente:
Input type exists
PHP completa del filtro de referencia