PHP 8 · Web, security and database
Escape output
Escape user-provided values before printing them in HTML, to prevent cross-site scripting.
echo htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
PHP 8 · Web, security and database
Escape user-provided values before printing them in HTML, to prevent cross-site scripting.
echo htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
Was this page helpful?