During website creation, the problem of removing HTML tags is used, matching HTML tags with regular expressions, and then using replace.
Public static stringReplacehtmltag (StringHTML,IntLength = 0 ){StringStrtext = system. Text.
'**************************************************' Function name: gottopic' function: truncated string, Chinese character one count two characters, English count a character' Argument: str----Original string' strlen----intercept length' Return
Strip_tags get rid of HTML and PHP tags. Syntax: string strip_tags (String str); Return value: String function type: Data processing content Description This function can remove any HTML and PHP tag strings contained in the string. If the HTML of
HTML code:
Copy Code code as follows:
plain
special i am special
plain
Script code:
Copy Code code as follows:
function Addremoveitemns () {
var $newLi = $ (' special and new i am new remove me ');
Strip_tags removes HTML and PHP tags. Syntax: stringstrip_tags (stringstr); Return Value: string type: description of data processing content htmlspecialchars converts special characters into HTML format. Syntax: stringhtmlspecialchars (stringstring)
Method 1: Disable html
The simplest way is to directly disable HTML tags without removing them. You can use the Replace () function. For example:
Strtext = Replace (strtext, "
Or directly disable all HTML:Strtext = Replace (strtext, "
Nov 17. 2005
In th e past two days, I finished the function of multiple file selection using JavaScript.
The implementation is built on the basis of reference (2). However, I encounter the following error when using it.
"Mfile. Children.
Small functions that remove HTML tags and javascript code
Function trip_html ($ html, $ len ){
// $ Html should contain an HTML document.
// In this example, the HTML tag and javascript code are removed.
This article mainly introduces PHPstrip_tags () to remove HTML, XML, and PHP labels. if you need some help, please refer to it.
Syntax:Strip_tags (string, allow );
String is required, which specifies the string to be checked.
(Optional) allowed
-(NSString *) filterhtml: (NSString *) HTML{Nsscanner * scanner = [Nsscanner scannerwithstring:html];NSString * Text = nil;while ([Scanner Isatend]==no){Find the starting position of the label[Scanner scanuptostring:@ "Find the end position of the
Zookeeper
We usually use htmlspecialchars () to filter html, but escape the html characters and display the html source code.
Use strip_tags () to remove html tags.
$ Str = 'href ';// Echo htmlspecialchars ($ str );Echo strip_tags ($ str );
@charset "Utf-8";/*! * @ Name: Base.css * @ function: 1, reset browser Default style * 2, set generic atomic class*//*prevents users from customizing the effect of background color on Web pages, adding allows users to customize
Reference:Http://www.cnblogs.com/newsouls/p/3995394.htmlhttp://blog.csdn.net/he20101020/article/details/21228311Content: PackageUtils;ImportJava.util.regex.Matcher;ImportJava.util.regex.Pattern;/*** Note: \ n Enter (\u000a) * \ t horizontal tab (\u00
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.