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 :)

Recommended Answers

All 5 Replies

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.

can you give simple example excluding the database queries?

$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.

$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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.