PHP·98 questionsHow to protect against XSS?SaveUpdated: 2026-08-31Answer•htmlspecialchars($data, ENT_QUOTES, 'UTF-8').•When outputting user data.•Content-Security-Policy header.•HTTPOnly cookies.•Use templating engines with auto-escaping.Ask AI to clarifyWas this answer helpful?HelpfulNot helpfulSuggest an improvement