Final answer:
The correct answer is C) filter_input(). PHP provides several built-in functions that can be used to validate user input. One commonly used function is filter_input().
Step-by-step explanation:
The correct answer is C) filter_input().
PHP provides several built-in functions that can be used to validate user input. One of the most commonly used functions is filter_input(). This function is used to filter user input with a specified filter and returns the filtered data or false if the filtering fails.
For example, to validate a user input as an email address, you can use the following code:
if (filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)) {
echo 'Valid email format';
} else {
echo 'Invalid email format';
}