1 2 3 4 | $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 . "…<a href=" #">READ MORE</a> |
Which should result in:
This is my sentence, there are many like it but…READ MORE
1 2 3 4 | $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 . "…<a href=" #">READ MORE</a> |
Which should result in:
This is my sentence, there are many like it but…READ MORE