Difference between htmlentities() and htmlspecialchars()
Difference between htmlentities() and htmlspecialchars()
htmlspecialchars only takes care of , single quote ‘, double quote ” and ampersand. htmlentities translates all occurrences of character
sequences that have different meaning in HTML.
htmlspecialchars
htmlspecialchars
- It Convert special characters to HTML entities
Syntax:
string htmlspecialchars ( string string [, int quote_style [, string charset]])
htmlentities
htmlentities
- It Convert all applicable characters to HTML entities
Syntax:
string htmlentities ( string string [, int quote_style [, string charset]])
