php - How to check if variable is empty using filter_input_array()? -


I am validating a form in which some fields should be in a particular format, and some must be filled ... I use

  $ array using the array ('' 'position' = & gt; array ('filter' = & gt; FILTER_VALIDATE_INT, 'option' => array ('min_range') Trusty = filter_input_array (INPUT_POST) = (1, 'max_range' => 3, 'default' => 2)), 'Tag' => array ('filter' => FILTER_CALLback, 'options '= & Gt; function ($ value) {If (mb_stros ($ value, ",") === incorrect) {return trim ($ value);} and {$ tag = explosion (",", $ value) $ Tag = array_map (function ($ val ) {Return trim ($ val);}, $ tags); $ tag return;}},)));  

To validate woos, which special format is required, but I also have the field 'title' and 'body', whatever may be but should not be empty . Of course I can see this separation but I want to do all the beliefs in one place. And my question is: is there a filter, or a flag that checks whether the variable is empty?

Maybe some array ('filter' => FILTER_VALIDATE_INT, 'options' => array ('Min_range' = 'A' ARR ('filter' => FILTER_CALLback, 'options' => function ($ value) {1, 'max_range' => 3, 'default' = & gt; 2)), 'tag' if (mb_stops ($ value, ",") === incorrect) {return trim ($ value);} and {$ tag = explosion (",", $ value); $ tag = Array_map (function ($ val) {return trim ($ val);}, $ tag); $ tag return;}},), 'title' = & gt; Array ('filter' = & gt; FILTER_CALLBACK, 'options' => function ($ value) {return return ($ value);})));

It should also work:

  'title' => Array ('filter' = & gt; FILTER_CALLBACK, 'options' = & gt; blank')  

Comments