Q. Which PHP function safely encodes output for HTML?
β
Correct Answer: (B)
htmlspecialchars()
Explanation: htmlspecialchars() prevents XSS by escaping special characters.