filter_var_array()

Filter multiple variable after reading them

General Format
==============

filter_var_array(array, args)

array – Array of values to be filtered

args – array of filter arguments

Example
=======

<?php
$array = array ( “zipcode” => “453441s”, “email” => “info@phpcodez.com”, );
$filters = array ( “zipcode” => FILTER_VALIDATE_INT, “email”=> FILTER_VALIDATE_EMAIL, );
print_r(filter_var_array($array, $filters));
?>

Output
=====

Array ( [zipcode] => [email] => info@phpcodez.com )

Leave a Reply

Your email address will not be published. Required fields are marked *