Link | string_removehtml |
Author | Jason Huck |
Category | String |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 29 Nov 2005 |
Updated | 16 Jan 2007 |
More by this author... |
Strips all HTML tags from the given string. Attempts to preserve some formatting.
var('testdata') = string(include_url('http://tagswap.net/')); '' + string_removehtml($testdata) + '';
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'removehtml', -namespace='string_', -priority='replace', -required='text', -type='string', -optional='linebreak', -type='string', -description='Strips HTML tags from the given string. Attempts to preserve some formatting.' ); local('out') = params->first; !local_defined('linebreak') ? local('linebreak' = '\n'); #out = string_replaceregexp( #out, -find='\\s+', -replace=' ', -ignorecase ); #out = string_replaceregexp( #out, -find='(?s)', -replace=#linebreak, -ignorecase ); #out = string_replaceregexp( #out, -find='(?s) ', -replace=(#linebreak * 2), -ignorecase ); #out = string_replaceregexp( #out, -find='(?s)<.+?>', -replace='', -ignorecase ); #out = decode_html(#out); return(@#out); /define_tag;
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Case sensitive