CFLib.org – Common Function Library Project

htmlDecode(HTML)

Last updated July 24, 2013

author

Adam Tuttle

Version: 1 | Requires: CF5 | Library: StrLib

Description:
Converts an HTML-escaped string back to normal HTML.

Return Values:
Returns a decoded string

Example:

<cfoutput>
#htmlDecode('Hello&lt;br/&gt;World!')#
</cfoutput>

Parameters:

Name Description Required
HTML A string to decode Yes

Full UDF Source:

/**
 * Inverse of HTMLEditFormat, similar to URLDecode
 * v1.0 by Adam Tuttle
 * 
 * @param HTML      A string to decode (Required)
 * @return Returns a decoded string 
 * @author Adam Tuttle (adam@fusiongrokker.com) 
 * @version 1.0, July 24, 2013 
 */
function htmlDecode(HTML){
    return replaceList(arguments.HTML, "&lt;,&gt;,&amp;,&quot;", '<,>,&,"');
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson