0
votes

I want to submit an array input

<input name="m[]" />

I know I can get the submitted values with JInput as

$input -> get('m', [], 'ARRAY')

I wonder if there is way to sanitate the retrieved data to get only integers, as it is done when we use

$input -> get('avar', 0, 'INT')

is it possible to do it with jInput or some other way arround?

thanks for your time.

1

1 Answers

0
votes

As described in the documentation you need to specify the key and its filter as the parameter.

https://docs.joomla.org/Retrieving_request_data_using_JInput

$fooValues = $jinput->getArray(array(
    'var1' => 'int',
    'var2' => 'float',
    'var3' => 'word'
));