Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Input ConstantsSanitization Filter Flags>
^Predefined ConstantsLast updated: Mon, 26 Oct 2026

Generic Filter Flags

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

FILTER_FLAG_NONE (int)

No flags.

FILTER_REQUIRE_SCALAR (int)

Flag used to require the input of the filter to be a scalar.

FILTER_REQUIRE_ARRAY (int)

Flag used to require the input of the filter to be an array.

FILTER_FORCE_ARRAY (int)

This flag wraps scalar inputs into a one element array for filters which operate on arrays.

FILTER_NULL_ON_FAILURE (int)

Use null instead of false on failure.

Usable with any validation FILTER_VALIDATE_* filter.

FILTER_THROW_ON_FAILURE (int)

Throws a Filter\FilterFailedException when a validation filter fails, instead of returning false.

Can be used with any validation FILTER_VALIDATE_* filter.

Available as of PHP 8.5.0.


<Input ConstantsSanitization Filter Flags>
^Predefined ConstantsLast updated: Mon, 26 Oct 2026