A

Admin • 833K Points
Coach

Q. Which PHP function can be used to safely output user input to prevent XSS attacks?

  • (A) htmlspecialchars()
  • (B) strip_tags()
  • (C) htmlentities()
  • (D) addslashes()
  • Correct Answer - Option(A)
  • Views: 25
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

htmlspecialchars() converts special characters to HTML entities to prevent XSS.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.