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.

Top ↑

Parameters Parameters




(string) (Required) Name of a variable to get.


(int) (Optional) The ID of the filter to apply. Default is FILTER_DEFAULT.

Default value: FILTER_DEFAULT


(mixed) (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()

Top ↑

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.

Top ↑

Source Source

File: includes/functions/llms-functions-wrappers.php

	function llms_filter_input( $type, $variable_name, $filter = FILTER_DEFAULT, $options = array() ) {
		return filter_input( $type, $variable_name, $filter, $options );

Top ↑

Changelog Changelog

Version Description
5.3.0 Moved location from includes/llms.functions.core.php.
3.29.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.