Hello everyone and thanks much for your past help.
I have two pages for an article -- a home page that I want to show only the first few paragraphs for an article that includes a link for the full article and then a page that will display a full article.
My question is: How do I break up the article after say 300 characters and make sure that it breaks up the article at the end of a paragraph? In other words, the script will parse up to 300 characters of the beginning of the article, then break the article off at the end of the nearest paragraph after reaching the 300 character limit. Make sense?
I have written the following code, where it will break up the article at the fourth paragraph, but I would really like to get it where it counts characters instead. Thanks for any help anyone may be able to share.
<?php if ($RSMiddle1['Body'] != "") {
$str = $RSMiddle1['Body'];
$temp = str_replace(chr(13), "<p>", $str); $elements = explode("<p>", $temp, 8);
$discard = array_pop($elements);
$new_string =implode("<p>", $elements);
print_r($new_string);
}
?>