I want to validate and sanitize data which comes from `POST` array. 

My `POST` data is something like this: 

```
Array
(
    [category_name] => fsdfsfwereq34
    [subCategory] => Array
        (
            [0] => sdfadsffasfasdf
            [1] => sdfasfdsafadsf
            [2] => safdfdasfas
        )

    [category-submitted] => TRUE
)
1

```

I can validate and sanitize `category_name` and this is how I do it in PHP. 

```
if (!empty( $_POST['category_name'])) { 
    $category = filter_input(INPUT_POST, 'category_name', FILTER_SANITIZE_STRING);  
} else {
    $category = NULL;
}

```

But I do not know how to do it for values of the `subCategory` array. 
Can anybody tell me how can I do this? 

Hope somebody may help me out. Thank you.