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;", '<,>,&,"');
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson