automator_filter_input_array( null $variable = null,  $type = INPUT_GET,  $flags = array() )


Parameters Parameters

$type

(Optional)

Default value: INPUT_GET

$variable

(null) (Optional)

Default value: null

$flags

(Optional)

Default value: array()


Top ↑

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();
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0 Introduced.