定义和用法
该filter_input_array ( )函数得到多重过滤器从外部输入的脚本和过滤它们。
这一功能是有益的过滤大量输入变量没有要求filter_input ( ) ,多。
这项功能可以输入几个来源:
INPUT_GET
INPUT_POST
INPUT_COOKIE
INPUT_ENV
INPUT_SERVER
INPUT_SESSION (尚未实施)
INPUT_REQUEST (尚未实施)
返回一个数组的过滤数据成功的,虚假的失败。
语法
filter_input(input_type, args)
input_type:要求。指定输入类型。见可能类型上述清单 args:可选。指定了一系列的过滤器的论点。
一系列有效的关键是一个变量名和一个有效的值是一个过滤器ID或一个数组指定过滤器,旗帜和选择。 这个参数也可以是一个单一的过滤器编号,如果是这样,所有的价值观在输入数组过滤指定的过滤器 过滤器编号可以是一个编号名称(如FILTER_VALIDATE_EMAIL )或身份证号码(如274 )
提示和说明 提示:请检查PHP的过滤器完全可能的参考过滤器来使用此功能。
例如 在这个例子中我们使用filter_input_array ( )函数过滤后三个变数。
收到后的变量是一个名字,年龄和e - mail地址:
<!--?php$filters = array ( "name" =-->array ( "filter"=>FILTER_CALLBACK, "flags"=>FILTER_FORCE_ARRAY, "options"=>"ucwords" ), "age" => array ( "filter"=>FILTER_VALIDATE_INT, "options"=>array ( "min_range"=>1, "max_range"=>120 ) ), "email"=> FILTER_VALIDATE_EMAIL, );print_r(filter_input_array(INPUT_POST, $filters));?>
返回值勤.
Array ( [name] => Peter [age] => 41 [email] => peter@example.com )

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools