automator_filter_input_array( null $variable = null, $type = INPUT_GET, $flags = array() )
Automator filter input array – get the $_POST/$_GET/$_REQUEST array variable
Parameters Parameters
- $type
-
(Optional)
Default value: INPUT_GET
- $variable
-
(Optional)
Default value: null
- $flags
-
(Optional)
Default value: array()
Return Return
(mixed)
Source Source
File: src/global-functions.php
function automator_filter_input_array( $variable = null, $type = INPUT_GET, $flags = array() ) { if ( empty( $flags ) ) { $flags = array( 'filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY, ); } /* * View input types: https://www.php.net/manual/en/function.filter-input.php * View flags at: https://www.php.net/manual/en/filter.filters.sanitize.php */ $args = array( $variable => $flags ); $val = filter_input_array( $type, $args ); return isset( $val[ $variable ] ) ? $val[ $variable ] : array(); }
Expand full source code Collapse full source code View on Github
Changelog Changelog
Version | Description |
---|---|
3.0 | Introduced. |