What is the PHP function to sanitize a string?

  • filter_var()
  • sanitize_string()
  • clean_string()
  • validate_string()
The PHP function to sanitize a string is filter_var(). It can be used to apply filters and sanitization options specifically designed for strings, such as removing HTML tags, escaping special characters, and stripping or encoding unwanted characters. The filter_var() function provides a convenient and reliable way to sanitize strings in PHP. To learn more, visit: http://php.net/manual/en/function.filter-var.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *