小白教程
所有教程
关于
Search
172.69.7.167
172.69.7.167
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Func filter has var”的源代码
本页内容
下一节:
Func_filter_id
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:filter_has_var()}}[[Category:PHP Filter 参考手册|1]] = PHP filter_has_var() 函数 = [[:Category:PHP Filter 参考手册]] == 定义和用法 == filter_has_var() 函数检查是否存在指定输入类型的变量。 如果成功则返回 TRUE,如果失败则返回 FALSE。 == 语法 == <pre> filter_has_var(type, variable) </pre> {| class="table table-striped table-hover" !width="50%"| 参数 !width="50%"| 描述 |- | type | 必需。规定要检查的类型。 可能的输入类型: * INPUT_GET * INPUT_POST * INPUT_COOKIE * INPUT_SERVER * INPUT_ENV |- | variable | 必需。规定要检查的变量。 |} 在本实例中,输入变量 "name" 被发送到 PHP 页面: <sample title="" desc="" lang="php" hererun="1"> <?php if(!filter_has_var(INPUT_GET, "name")) { echo("Input type does not exist"); } else { echo("Input type exists"); } ?> </sample> 代码的输出如下所示: <pre> Input type exists </pre> [[:Category:PHP Filter 参考手册]]
返回至“
Func filter has var
”。
下一节:
Func_filter_id