llms_filter_input( int $type, string $variable_name, int $filter = FILTER_DEFAULT, mixed $options = array() )
Gets a specific external variable by name and optionally filters it
Description Description
This is a pluggable wrapper around native filter_input
which is plugged in the testing framework to allow easy mocking of form variables when testing form controller functions and methods.
Parameters Parameters
- $type
-
(Required) One of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.
- $variable_name
-
(Required) Name of a variable to get.
- $filter
-
(Optional) The ID of the filter to apply. Default is
FILTER_DEFAULT
.Default value: FILTER_DEFAULT
- $options
-
(Optional) Associative array of options or bitwise disjunction of flags. Default is empty array. If filter accepts options, flags can be provided in "flags" field of array.
Default value: array()
Return Return
(mixed) Value of the requested variable on success, FALSE if the filter fails, or NULL if the variable_name variable is not set. If the flag FILTER_NULL_ON_FAILURE is used, it returns FALSE if the variable is not set and NULL if the filter fails.
Source Source
File: includes/llms.functions.core.php
Changelog Changelog
Version | Description |
---|---|
3.29.0 | Introduced. |