PHP Filter, how to filter input array

Posted by esryl on Stack Overflow See other posts from Stack Overflow or by esryl
Published on 2010-05-03T20:11:28Z Indexed on 2010/05/03 20:18 UTC
Read the original article Hit count: 679

Filed under:
|
|

I am using PHP filter to perfom basic sanitization and validation of form data.

The principle problem I am having is that I mark my form up so that all the data is in one array for the POST input. e.g. form fields, page[name], page[slug], page[body], page[status], etc.

Using the following:

filter_input(INPUT_POST, 'page[name]', FILTER_SANITIZE_STRING);
OR
filter_input(INPUT_POST, "page['name']", FILTER_SANITIZE_STRING);

I am unable to access the variable. Can someone please tell me the correct name to use to access array data using filter_input()

© Stack Overflow or respective owner

Related posts about php

Related posts about filter