Prevent XSS attacks by escaping HTML using htmlspecialchars().
Source Code
$html = "Test";
$safeHtml = htmlspecialchars($html);
echo $safeHtml; // Outputs: <a href='test'>Test</a>
Prevent XSS attacks by escaping HTML using htmlspecialchars().
$html = "Test";
$safeHtml = htmlspecialchars($html);
echo $safeHtml; // Outputs: <a href='test'>Test</a>