php filter_has_var determines whether a variable exists function_PHP tutorial

WBOY
Release: 2016-07-20 11:00:31
Original
1108 people have browsed it

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
Copy after login
Copy after login
Copy after login
	type
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
Copy after login
Copy after login
Copy after login
例如
在这个例子中的输入变量“名称”发送到PHP页面:
Copy after login
Copy after login
Copy after login
Copy after login
<!--?phpif(!filter_has_var(INPUT_GET, "name")) { echo("Input type does not exist"); }else { echo("Input type exists"); }?-->
Copy after login
输出为.
Copy after login
 Input type exists
Copy after login

www.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)...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!