Hello. Help me to understand.

There are form fields:

<form> <input type="text" name="answer[]['answer']" value="1" /> <input type="text" name="answer[]['answer_note']" value="2" /> </form> //$post = array(answer=>('filter' => ..., 'flag' => ...)); $result = filter_input_array(INPUT_POST, $post); 

How to create a $post для filter\_input\_array for this form?

    1 answer 1

    If validation is needed and, judging by the values ​​of the fields that they are a valid integer, you can do this:

     $args = array( 'answer' => array( 'filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY, ) ); $result = filter_input_array(INPUT_POST, $args); 

    Other filters can be found here.