htmlspecialchars : converts only some characters to their html equivalents. This is preferred over htmlentities.
htmlentities: converts all characters to their html equivalents. This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
htmlentities is only necessary if your pages use encodings such as ASCII or LATIN-1 instead of UTF-8.
html_entity_decode: Convert all HTML entities to their applicable characters. html_entity_decode() is the opposite of htmlentities()