PHP Function For Returning First n Characters of a Paragraph

This function will return the first n (the number you request) characters careful to not break in the middle of a word. getSummary is also removing html tags, trimming whitespace to improve accuracy, and adding an ellipsis at the end. At it’s core is the php built in function word_wrap that splits a string by a specified character which allows us to grab the 1st part.