1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which one of the following filter is used to filter…

Added 19 Jan 2024

Which one of the following filter is used to filter several variables with the same or different filters?

  1. filter_var_array() Correct answer
  2. filter_var()
  3. filter_input
  4. filter_input_array

Correct answer

A. filter_var_array()

14 views

MCQSEXAM

Explanation

filter_var_array() takes an array of variables and applies either one filter to all of them or a different filter to each key, returning the filtered values in a single call.

By comparison, filter_var() handles only one variable, while filter_input() and filter_input_array() read values from external sources such as $_GET and $_POST. Knowing which filter function fits which job is a common PHP interview and test question.

Practise more Computer Science MCQs with answers and explanations on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs