Hi Lester, On Fri, Aug 12, 2016 at 8:13 PM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote: > On Fri, Aug 12, 2016 at 8:06 PM, Lester Caine <les...@lsces.co.uk> wrote: >> On 12/08/16 11:51, Yasuo Ohgaki wrote: >>> What makes you feel missing some or designed badly? >> >> I may be missing something, but I thought the original code had rules >> for each element of the array? I would certainly expect to see the >> capability of setting different validating rules for each element, and >> the rules you are defining are the same rules that would be needed on a >> variable by variable basis? > > You can do > > $get_def_for_an_api = array( > 'date' => $my_date_spec, > 'bookname' => $my_bookname_spec, > 'isbn' => $my_isbn_spec, > ); > > filter_require_var_array($_GET, $get_def_for_an_api); > > One missing validation filter is "optional" filter. I may add this > later or now before starting vote.
"optional" filter can be defined by "callback" filter without dedicated filter for optional inputs, BTW. Regards, -- Yasuo Ohgaki yohg...@ohgaki.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php