How to automatically intercept the content of an article as an overview of the article

Source: Internet
Author: User
How to automatically intercept the content of an article as an introduction to the article? what I want to achieve is to automatically intercept 100 words as an introduction to the article when adding an article, but because the content is formatted text, how can I remove the html format and only intercept the part of the article? Share to: how to automatically intercept the content of an article as an introduction to the article
What I want to achieve is that when I add an article, the content is automatically truncated by 100 words as the article introduction, but because the content is formatted text, how can I remove the html format, what about intercepting only part of the article?

Share: More


------ Solution --------------------
Php provides the strip_tag function to remove html tags.
To prevent Chinese characters from being truncated, php provides the iconv_substr and mb_substr functions.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.