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

  • Home
  • SEARCH
  • 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 7986669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:55:17+00:00 2026-06-04T11:55:17+00:00

I am currently developing a CMS and want to add in the functionality of

  • 0

I am currently developing a CMS and want to add in the functionality of limiting an excerpt of text by its line length. Say I want to control the display of text and ensure all blocks are the same height by controlling the amount of lines of text that show.

Does any know of any pre-written function or perhaps article to help get me started? It would gratefully be appreciated. Thank you.

  • 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-06-04T11:55:19+00:00Added an answer on June 4, 2026 at 11:55 am

    You can use the native wordwrap() function to control how many characters are permitted per line. This function would also permit you to limit the number of lines you would like to show as well by exploding the results on the break-sequence, and gluing together any number of the resulting array values.

    $s = "This is the long string I wish to wrap to multiple lines.";
    
    list( $one, $two ) = explode( PHP_EOL, wordwrap( $s, 25, PHP_EOL ) );
    
    # This is the long string I wish to wrap to multiple...
    echo "$one $two...";
    

    Here I have limited each line to 25 characters, at most. I’ve then taken the first two lines and printed them out, one after another.

    Demo: http://codepad.org/8aCusZGQ

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

Sidebar

Related Questions

I am currently developing a cms and want to reuse the functionality in other
I am currently developing a CMS and want to encode special chars in the
I'm currently involved with developing a C# CMS-like web application which will be used
I am currently developing a webpage where I want to use the ToggleClass function
I'm currently developing a CMS for a website I'm making. I'm using MVCScaffolding to
I am currently developing my project using Spring, Sutruts2 & Hibernate. Now i want
I'm currently developing (another) Open Source CMS in PHP and I'd like to use
I'm developing a php based CMS, and I'm currently re-writing it into a state
I'm currently developing the front end of a new CMS for a digital streaming
Background: I am currently developing a Java front end for an Enterprise CMS database

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.