PHP – Truncate a string to a given length

This is a function I use to display the ellipses when I want to truncate and display a summary of a larger body of text.

 

Leave a Reply

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