Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7652727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:50:44+00:00 2026-05-31T11:50:44+00:00

Anyone know of a script or already built function that will help me create

  • 0

Anyone know of a script or already built function that will help me create a quick excerpt using already existing markdown formatted content?

I am looking at formatting results like StackOverflow where I have the title, and a short excerpt, for basically news view. I want to remove the markdown fully and just preserve the few words.

My concern is that I am going to use a codeigniter helper word_limiter()to limit the output. Which may create broken markdown:

**This is a sentence which has some _markdown_ that is [cutoff..

So I’m not sure how to go about it.

All my content is stored with markdown (not HTML formatting) otherwise I would do ‘striptags’ etc;

I’ve found something similar for Ruby on SO here: Truncate Markdown?, but I would love something for PHP.

I’m just not sure if I should just strip all *_[]()> characters basically? But if there is a URL (split in half), I’m worried it will look nasty.

Thoughts? I’ve looked around a bit, but at first glance haven’t found anything that strips markdown.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:50:45+00:00Added an answer on May 31, 2026 at 11:50 am

    Consider marking-up the text, then running strip_tags.

    — Update —

    There are a couple of other options, if you do not want to mark-up the text just to strip tags, you can:

    1. Introduce a regex to strip out the markdown elements

    2. Store the content in the database with NO markup/markdown, just the text

    3. If you mark-up then strip_tags, you can store the results in memcache to avoid the extra overhead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of an already-written Python script, tool, or editor that will check
Does anyone know of a script that can select all text references to URLs
I just wondered if anyone knew of a simple script available that will do
Anyone know of a script that would give CSS3 support to IE 7 please?
Does anyone know how to change text language from Recaptcha? I've already tried: <script
Does anyone know a script which would wrap old Products namespace style Plone add-on
Does anyone know of a script to colorize C++ code the same as the
Anyone know a good external link tracking script ? IE. to catch links and
Possible Duplicate: PHP: Script for generating Crossword game? Does anyone know any PHP-based simple
Anyone know a PHP scripts that done a good compression for jQuery?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.