/ Published in: ASP
URL: http://reusablecode.blogspot.com/2009/02/htmlspecialchars.html
ASP implementation of the PHP functions with the same names.
Expand |
Embed | Plain Text
<% ' Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved. ' ' This work is licensed under the Creative Commons Attribution License. To view ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California ' 94305, USA. ' Convert special characters to HTML entities. function htmlspecialchars(someString) ' Critical that ampersand is converted first, since all entities contain them. htmlspecialchars = replace(replace(replace(replace(someString, "&", "&"), ">", ">"), "<", "<"), """", """) end function ' Convert HTML entities to special characters. function htmlspecialchars_decode(someString) htmlspecialchars_decode = replace(replace(replace(replace(someString, "&", "&"), ">", ">"), "<", "<"), """, """") end function %>
You need to login to post a comment.
