title: split text into parts
body: <p>I wanted to split a large text into 10 pieces (somehow equal parts).
  Ii use this function:</p>
  
  <pre><code>&lt;?php
  function chunk($msg) {
     $msg = preg_replace('/[\r\n]+/', ' ', $msg);
     //define character length of each text piece
     $chunks = wordwrap($msg, 10000, '\n');
     return explode('\n', $chunks);
  }
  
  $arrayys=chunk($t);
  foreach($arrayys as $partt){echo $partt."&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;";}
  ?&gt;
  </code></pre>
  
  <p>But is it possible to define <strong>word length</strong> of each text piece (not <strong>character length</strong> )? how to <strong>divide text into words</strong> in such situation?</p>