Skip to content

Encoding and Escaping

Encoding and escaping are used to safely handle strings.

Common functions:

  • htmlspecialchars()
  • htmlentities()
$text = "<b>Hello</b>";
echo htmlspecialchars($text);