How does the PHP manual recommend handling variables in $_REQUEST for security reasons?

To handle variables in $_REQUEST for security reasons, the PHP manual recommends using specific filtering functions to sanitize the input data. This helps prevent injection attacks and ensures that only expected data types are accepted. One common filtering function is filter_input(), which can be used to sanitize input from $_REQUEST using a specified filter.

$filtered_variable = filter_input(INPUT_REQUEST, 'variable_name', FILTER_SANITIZE_STRING);