πŸ“Š PHP
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()
πŸ’¬ Discuss
βœ… Correct Answer: (A) htmlspecialchars()

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

Explanation by: Rati Dubey
htmlspecialchars() converts special characters to HTML entities to prevent XSS.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
34
Total Visits
πŸ“½οΈ
6 mo ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
85%
Success Rate