A
A
Anton B2015-10-07 15:53:26
PHP
Anton B, 2015-10-07 15:53:26

How to use filter_input for key and value?

Good afternoon.
When we expect an array of numbers, we can use the code

filter_input(INPUT_POST, 'arr', FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY);

What about when I expect an associative array where the keys should be strings and the values ​​should be numbers?
Only build a construction from filter_input() + filter_var() for keys?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2015-10-07
@AloneCoder

php.net/manual/en/function.filter-input-array.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question