urielk Posted April 5, 2011 Share Posted April 5, 2011 Hi, I want to show part of the text from a page containing my article on my main page. The article resides in a database in mysql. How do I limit the amount of text that is shown without setting up a separate excerpt box for the article. I want to then provide a link so the user can go to another page that displays the entire article. Thanks for any suggestions. Link to comment https://forums.phpfreaks.com/topic/232799-show-partial-text-from-page/ Share on other sites More sharing options...
SamT_ Posted April 5, 2011 Share Posted April 5, 2011 Be sure to select your article text from the database. The code below will cut off the message after the first 255 characters. $piece = substr($article_content, 0, 255) Link to comment https://forums.phpfreaks.com/topic/232799-show-partial-text-from-page/#findComment-1197426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.