home of the Help (www.Bkjia.com) tutorialOften we need to go to a string of strings in an HTML string, and here are a few ways that PHP handles such problems:
1.strip_tags () function: You can filter out HTML and PHP tags and return a completely new string!
Usage:
String Strip_tags (string to be processed [, the label that string wants to retain])
For example: tags, just write, Strip_tags ($str, ""), if you want to keep more than one label, the labels are separated by a space.
2. Mix with Strpos, substr
When we want to intercept the string, there is a unique identifier, usually can use this method, such as a unique ID with a label ABC, as long as the find and, the middle of the content is out.
3.PHP DOMDocument
DOMDocument provides a way to output plain text without any labels, and if you only need text data, use this method to pull the simplest
http://www.bkjia.com/PHPjc/364252.html www.bkjia.com true http://www.bkjia.com/PHPjc/364252.html techarticle Fire Net (liehuo.net) tutorial often we need to go to a string of strings in the HTML string, here are a few ways to handle the problem of PHP: 1.strip_tags () function: can filter out ...