Difference between htmlentities() and htmlspecialchars()

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]])

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.