HTML - Encode and Decode Functions

In this Page

The HTML encode and decode functions can be used to encode/decode strings into/from HTML entities.

encode

Description

Encodes plain text into HTML by converting characters into HTML entities. 

Syntax
Example

Expression: HTML.encode('One & Two')

where $string is plain text.

Result: "One & Two"

decode

Description

Decodes HTML into plain text by converting HTML entities into characters. 

Syntax
Example

Expression: HTML.decode('One & Two')

where $string is HTML encoded.

Result: "One & Two"