Home »

What is role of htmlentities?

Question ListCategory: PHPWhat is role of htmlentities?
ethanbrown author asked 8 years ago
1 Answers
adamemliy16 author answered 8 years ago

htmlentities is used to convert all applicable characters to HTML entities.It is used to stop the user from running malicious code in HTML.
With use of htmlentities, user can’t run the html tags like h2, p, script etc.
It helps to prevent you fromXSS attack.
echo htmlentities($userData);

Please login or Register to Submit Answer