Back to Input class

Method getArray

public mixed
getArray
(array $vars = array(), mixed $datasource = null, mixed $defaultFilter = 'unknown')
Gets an array of values from the request.
Parameters
  • array $vars Associative array of keys and filter types to apply. If empty and datasource is null, all the input data will be returned but filtered using the filter given by the parameter defaultFilter in InputFilter::clean.
  • mixed $datasource Array to retrieve data from, or null.
  • string $defaultFilter Default filter used in InputFilter::clean if vars is empty and datasource is null. If 'unknown', the default case is used in InputFilter::clean.
Returns
  • mixed The filtered input data.
Since
  • 1.7.0
Deprecated
  • 5.0
Class: Input
Project: Joomla

Method getArray - Source code

/**
 * Gets an array of values from the request.
 *
 * @param   array   $vars           Associative array of keys and filter types to apply.
 *                                  If empty and datasource is null, all the input data will be returned
 *                                  but filtered using the filter given by the parameter defaultFilter in
 *                                  InputFilter::clean.
 * @param   mixed   $datasource     Array to retrieve data from, or null.
 * @param   string  $defaultFilter  Default filter used in InputFilter::clean if vars is empty and
 *                                  datasource is null. If 'unknown', the default case is used in
 *                                  InputFilter::clean.
 *
 * @return  mixed  The filtered input data.
 *
 * @since   1.7.0
 * @deprecated  5.0  Use Joomla\Input\Input instead
 */
public function getArray(array $vars = array(), $datasource = null, $defaultFilter = 'unknown')
{
    return $this->getArrayRecursive($vars, $datasource, $defaultFilter, false);
}