encodeentities()

 
Returns a copy of string in which all characters have been converted to their HTML entity equivalents, where applicable (for example, & is converted to "&"). This function is the opposite of decodeentities.
Syntax
encodeentities( string )
Returns an entity encoded string.
User Annotations: encodeentities