How to sanitize request->getPost in bulk/array |
Hi,
So far based on documentation, it stated we can sanitize multiple field in an array but only for 1 same filter. PHP Code: $request->getPost(['field1', 'field2'], FILTER_SANITIZE_STRING); However, is there any way we can also sanitize multiple field for multiple filter? example like below. PHP Code: $request->getPost([ or, i really need to sanitize 1 by 1 based on the FILTER? it just that, if my function require a lot of POST, that would be disaster to sanitize line by line.
PHP.NET has a filter_input_arry method that you may be able to use.
PHP.NET - filter_input_array See the first example of it's use. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |