You are writing a PHP script and you need to sanitize user input. How would you do this?
- filter_input()
- sanitize_input()
- validate_input()
- clean_input()
To sanitize user input in PHP, you can use the filter_input() function. This function allows you to filter and sanitize user input based on predefined filters or custom filters. It provides a convenient way to ensure that the input is safe and free from unwanted content. For more information, refer to: http://php.net/manual/en/function.filter-input.php
Loading...
Related Quiz
- The is_numeric() function in PHP checks if a variable is a(n) ______.
- What is the operator used for addition in PHP?
- echo and print are functions in PHP.
- You have an associative array in your PHP script and you're encountering issues with accessing or manipulating the elements. How would you debug this?
- What does $_SERVER mean?