Programming Languages
PHP
Objective
Sep 23, 2025
Which PHP function is used to prevent XSS attacks when outputting user data?
Detailed Explanation
Explanation: htmlspecialchars() converts special characters to HTML entities, preventing XSS attacks. It should be used when outputting user data to HTML. Use ENT_QUOTES flag to also convert quotes.
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts