I want to use part of a blog post as the introduction to the post and then add a "read more" link at the end, but I couldn't find a way to round up the text either at the end of a word or sentence. The code below runs into an empty infinite loop.
<?php
$num_of_words = 400;
while (! substr($article, $num_of_words, 1) != "")
$num_of_words++;
?>
Any help please? Thanks