C_STRING
C_STRING = 1
Performs safe variable parsing based on types which can be used by users. This may not be able to represent all possible data inputs, however.
parse(mixed $var, int $type, bool $allow_null = false) : string
Validate a variable according to type.
It may return NULL as a valid type if $allow_null is true.
mixed | $var | Variable to validate |
int | $type | Type of variable, see HTMLPurifier_VarParser->types |
bool | $allow_null | Whether or not to permit null as a value |
Validated and type-coerced variable
parseImplementation(mixed $var, int $type, bool $allow_null) : array|bool|float|int|mixed|null|string
Actually implements the parsing. Base implementation does not do anything to $var. Subclasses should overload this!
mixed | $var | |
int | $type | |
bool | $allow_null |