normalize.php
Table of Contents
Functions
- normalize() : mixed|null
- Normalizes a value according to the given cleaning flags.
Functions
normalize()
Normalizes a value according to the given cleaning flags.
normalize(mixed $value[, int $flags = CleanFlag::DEFAULT | CleanFlag::RETURN_NULL ]) : mixed|null
- Arrays are cleaned recursively using the provided flags.
- Strings are trimmed if
CleanFlag::TRIMis set, and empty strings become null ifCleanFlag::EMPTYis set. - Other scalar values are returned as-is, unless
CleanFlag::FALSYis used.
Parameters
- $value : mixed
-
The value to normalize (array or scalar).
- $flags : int = CleanFlag::DEFAULT | CleanFlag::RETURN_NULL
-
A bitmask of CleanFlag values. Defaults to
CleanFlag::DEFAULT | CleanFlag::RETURN_NULL.
Tags
Return values
mixed|null —The normalized value, cleaned array, or null if the result is empty and RETURN_NULL is set.