Definition and usage
The filter_has_var() function checks if a variable of the specified input type exists.
Returns TRUE or FALSE on success on failure.
Grammar
filter_has_var(type, variable)
Copy after login
|
-
必需的。指定类型检查可能存在的输入类型:
INPUT_GET
- INPUT_POST
- INPUT_COOKIE
- INPUT_SERVER
- INPUT_ENV
|
variable |
必需的。指定变量检查
|
|
-
Required. Specify type checking for possible input types:
INPUT_GET
- INPUT_POST
- INPUT_COOKIE
- INPUT_SERVER
- INPUT_ENV
|
variable |
Required. Specify variable check
|
例如
在这个例子中的输入变量“名称”发送到PHP页面:
Copy after login
<!--?phpif(!filter_has_var(INPUT_GET, "name")) { echo("Input type does not exist"); }else { echo("Input type exists"); }?-->
Copy after login
Input type exists
Copy after login
http://www.bkjia.com/PHPjc/445506.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445506.htmlTechArticleDefinition and Usage The filter_has_var() function checks if a variable of the specified input type exists. Returns TRUE or FALSE on success on failure. Syntax filter_has_var(type, variable)...