Apply a common filter with filter_var_array??
Posted: Thu Mar 19, 2009 12:57 pm
Hi,
I've tried various combinations and permutations of filter_var_array() and have yet to find the answer to this:
Given a rather large associative array, I need to apply FILTER_SANITIZE_STRING with the FILTER_FLAG_ENCODE_HIGH flag to all of the elements in the array.
So:
filter_var_array($my_big_array,FILTER_SANITIZE_STRING);
applies the FILTER_SANITIZE_STRING filter but without the FILTER_FLAG_ENCODE_HIGH flag.
How can I specify FILTER_SANITIZE_STRING + FILTER_FLAG_ENCODE_HIGH with filter_var_array? (easily)
I want to avoid having to create a filter+flag+option array for every element in $my_big_array.
Any Help?
M
I've tried various combinations and permutations of filter_var_array() and have yet to find the answer to this:
Given a rather large associative array, I need to apply FILTER_SANITIZE_STRING with the FILTER_FLAG_ENCODE_HIGH flag to all of the elements in the array.
So:
filter_var_array($my_big_array,FILTER_SANITIZE_STRING);
applies the FILTER_SANITIZE_STRING filter but without the FILTER_FLAG_ENCODE_HIGH flag.
How can I specify FILTER_SANITIZE_STRING + FILTER_FLAG_ENCODE_HIGH with filter_var_array? (easily)
I want to avoid having to create a filter+flag+option array for every element in $my_big_array.
Any Help?
M