htmlspecialchars is an extremely useful PHP function, but proves useful in more languages that just PHP. It is necessary to use these HTML entities whenever you want HTML to display as plain text instead of being parsed.