htmlspecialchars ()
does the minimum amount of encoding to ensure that your string is not parsed as HTML. This leaves your string more human-readable than it would be if you used htmlentities ()
to encode absolutely everything that has an encoding.