Q. Which PHP function is used to escape output to prevent XSS?
β
Correct Answer: (B)
htmlspecialchars()
Explanation: htmlspecialchars() prevents XSS by escaping HTML.