0

Hi All,
I'm still exercising with that small PHP/MYSQL CMS of mine.
I have a question that I need help from you guys. I see in many CMS like Drupal where there is loong articles let say 10 of them are displayed on single page.

For some technique I don't know, they split up each article into limited summary with a link saying "read more ยป" and when you click a link then you have full article.

Here is my question: How do I make those summary?
I know how to make a link that pulls the whole article but NOT how to make a summary

Thanks for your time buddies :)

2
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by Stefano Mtangoo
0

I might not be the best person to chime in on this, but couldn't you just use something like substr() to limit the text output for the summary? I've used it for a similar application and seemed to work just fine.

0
$article = ' This is your full article';
$summary = substr($article,0,500);

echo ''.$summary.' <link to full article>';

Adjust the 500 to the number of characters you would like to output as summary from the main article.

0
$article = ' This is your full article';
$summary = substr($article,0,500);

echo ''.$summary.' <link to full article>';

Adjust the 500 to the number of characters you would like to output as summary from the main article.

That is great man,
thanks alot. I think I have to make a function or rather a method to do it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.