php filter_has_var 判断变量是否存在函数
定义和用法
该filter_has_var()函数检查,如果一个变量指定输入类型存在。
在返回TRUE或FALSE成功的失败。
语法
filter_has_var(type, variable)
type必需的。指定类型检查可能存在的输入类型:INPUT_GETINPUT_POSTINPUT_COOKIEINPUT_SERVERINPUT_ENVvariable必需的。指定变量检查
例如在这个例子中的输入变量"名称"发送到PHP页面:
<?php if(!filter_has_var(INPUT_GET, "name")) { echo("Input type does not exist"); } else { echo("Input type exists"); }
输出为.
Input type exists
本文地址:http://www.phprm.com/function/01a7d98d627ef85c7bbcb3f6df4c0c29.html
转载随意,但请附上文章地址:-)