PHP Word count and sentence break

I have a form that I want to submit a Large set of text into.

I want to break it into paragraphs.

So I want to count in 3 -5 Sentences  add a line break and put in a word like BREAK or #BREAK# in between each set then echo it back to the screen.

How would this be done?
A sentence ends with a      .    or a ! or a ?
Also how can I show a total word count of the input text?

Here is the form that I have that submits the data.

<title>paragraph burst</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<form name="form1" method="post" action="<? $phpself; ?>">
  <p> Insert Text<br>
    <textarea name="original_text" cols="150"></textarea>
  <p>min Sentence
    <input name="min" type="text" value="3" size="4">
    Max sentence
    <input name="max" type="text" value="5" size="4">
    Break Token
    <input name="break_name" type="text" value="#BREAK#">
    <input type="submit" name="Submit" value="Submit">

I hope that this is easy..
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I dont full understand your question, however to wrap a line of text use wordwrap

$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20, "<br />\n");

echo $newtext;

to count the characters use the strlen function

$test = 'hello';

echo strlen($test); - outputs 5

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
you can use <a href="">preg_split()</a>

and a perl regexp to split it into arrays of sentances something like preg_split("[.!?]",$mytext)

then output then from the array as use feel the need

foreach( $array as $key => $value){}
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.