Filter Class Reference

Detailed Description

Filter validates against the given php filter.

Configuration examples:

// FILTER_VALIDATE_INT with min_range option and FILTER_FLAG_ALLOW_HEX flag
filter:{"type":"int","options":{"options":{"min_range":0},"flags":2}}
// FILTER_VALIDATE_BOOLEAN simple and with FILTER_NULL_ON_FAILURE flag
filter:{"type":"boolean"}
filter:{"type":"boolean","options":{"flags":134217728}}
// FILTER_VALIDATE_REGEXP with regexp option
filter:{"type":"validate_regexp","options":{"options":{"regexp":"/^[0-9]*$/"}}}
// FILTER_UNSAFE_RAW with FILTER_REQUIRE_ARRAY flag
filter:{"type":"unsafe_raw","options":16777216}
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 37 of file Filter.php.

+ Inheritance diagram for Filter:

Public Member Functions

 validate ($value, $options=null, $context=null)
 

Member Function Documentation

◆ validate()

validate (   $value,
  $options = null,
  $context = null 
)
See also
ValidateType::validate $options is an associative array with keys 'type' and 'options' (optional)

Implements ValidateType.

Definition at line 43 of file Filter.php.