PHP: Get excerpt from the text

Share Button

The following function will extract the excerpt from the given paragraph text. Following function accepts two arguments.

$text is the text supplied to be excerpted.
$number is the number of words to be returned.

If you have any questions, post below.

I have been developing web sites since 2004 and currently working in London as a Senior Web Developer with responsibility for PHP/MySQL backend systems and jQuery frontend development. My ulitmate focus is on server side programming, release process, automation, and standards based web site design especially on Zend Framework. I also have a keen interest in developing Wordpress plugins and contributing to open source projects.

Leave a Comment

Your email address will not be published. Required fields are marked *