On 12/08/16 12:13, Yasuo Ohgaki wrote: >> 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.
But my point is you have code to process the rule set $my_date_spec against the variable $date and ditto on bookname and isbn. All three of them are elements I have user land code to validate, and I don't see what is so special about making that validation available inside an array against simply having $date->rules($my_date_spec) and return $date->valid; ... -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php