What are the differences between htmlspecialchars() and htmlentities(). When should I use one or the other?
htmlspecialchars()
htmlentities()
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.
htmlspecialchars ()
htmlentities ()