Useful for giving a teaser of a post and then including … on the end followed by “Read More”.
$sentence = "This is my sentence, there are many like it but this one is mine. What do you think of it?"; $n = 10; // Customize to however many words you want to actually show $teaser = implode(' ', array_slice(explode(' ', $sentence), 0, $n)); echo $teaser."...READ MORE
Which should result in:
This is my sentence, there are many like it but…READ MORE