Function htmlspecialchars() and htmlentities()
Convert special characters to HTML entities with htmlspecialchars(), htmlentities() and backwards with htmlspecialchars_decode(), htmlentities_decode(), html_entity_decode()
Source string:
Convert
Result:
htmlspecialchars(): Convert special chars to entities
htmlspecialchars_decode(): Decode entities to characters
htmlentities(): Convert all applicable characters to entities
htmlentities_decode(), html_entity_decode(): Decode entities back to characters