/// /// Convert the HTML tag to Kong Jia Shiyi/// /// string to be converted /// converted string Public static string getstringnohtml (string strhtml){If (string. isnullorempty (strhtml )){Return strhtml;}Else{String [] aryreg = {@ " ",@ " )? ",@
Strip_tags get rid of HTML and PHP tags.Syntax: string strip_tags (String str);return value: StringTypes of functions: Data processingContent DescriptionThis function can remove any HTML and PHP tag strings contained in the string. If the HTML and
Cited by: http://taoistwar.iteye.com/blog/278963Today to do a drag effect, find a template on the Internet, after the hair to find a drag will select other parts of the page, need to remove this effect,Looked for a template to see the following
01./**02. * Remove the HTML code inside the string. 03. * Require data to be standardized, such as greater than less than the number to support, or will be the collective manslaughter.04. ** @param content* ContentThe contents of @return
This method removes any HTML and PHP tag strings contained in the string, such as:
$str = " Text content ';
echo "1." $str. " ";
echo "2." Strip_tags ($STR);
The first output of the picture and text content in the table, the second output only
Original reprint Please indicate the source:
Using regular processing, do not know whether there will be performance problems, not too much testing.
At present I have a lot of use beautifulsoup to do this kind of processing.
The HTML entity deals
The method basically comes from the source code in the thinkphp, but has been modified by me
Copy Code code as follows:
/*
* @Description: Delete HTML tags and get plain text. can handle nested labels
*
*/
Class deletehtmltags{
Today, I was suddenly asked to read data from the database sometimes with HTML tags, and if the data is packed in a container such as TextBox, the tags will be output as strings, this is definitely not your own effect, so how to remove these HTML
PHP strip_tags () function
Definition and usage
The strip_tags () function removes tags from HTML, XML, and PHP.Syntax
strip_tags(string,allow)
Parameters
Description
String
Required. Specifies the string to be checked.
From: http://www.cnblogs.com/grokyao/archive/2008/12/04/1347512.html
The text obtained by using popular editors such as freetextbox is mixed with some HTML tags, and sometimes they need to be processed. Here we provide a solution, regular
The method basically comes from the source code in the thinkphp, but I changed it a bit.
Copy CodeThe code is as follows:
/*
* @Description: Delete HTML tags and get plain text. can handle nested labels
*
*/
Class deletehtmltags{
Private
First, use HTA to remove the HTM Control for verification.
Hta1
Code As follows:
Copy code The Code is as follows:
sample HTML application one
activexcontrol.htm code: copy Code the code is as follows:
In this way, the local
Because I sent XMLHTTP articles that batch crawled remote data some time agoHttp://blog.csdn.net/babyt/archive/2004/09/08/98516.aspxRecently, someone asked me how to save the article in text format, instead of simply using HTML storage, which will
The code for removing html tag attributes in php is as follows:
$ Str = 'test'; $ str = stripslashes ($ str); echo htmlspecialchars ($ str )."";
You want to enter test
In short: no matter $ str contains any attribute in the tag, only the tag
PHP strip_tags () goes to the function of HTML, XML, and PHP tags in the string, Strip_tagsxml
Strip_tags Definition and usage
The Strip_tags () function strips the HTML, XML, and PHP tags from the string.
Note: This function always strips HTML
Reprinted from: http://blog.sina.com.cn/s/blog_54318f230100mv46.html
function Replacehtmlandjs ($document) {$document = Trim ($document), if (strlen ($document) ]*?> ' Si ', //Remove HTML tag "' ([\ r \ n]) [\s]+ '",
Strip_tags removes HTML and PHP tags. Syntax: stringstrip_tags (stringstr); return value: string type: data processing content description this function can remove any HTML and PHP Mark strings contained in the string. If the HTML and PHP labels of
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.