title: Function explode() after x characters, not punctuation
body: <p>I'm creating an application where the user is suppose to type a text as correctly as possible. The text is coming from a database and its placed in a string. I'm displaying the string in a <code>div</code> and if the length of the string is to long for the <code>div</code> I want to split it. I know there have been similar questions before, but I haven't found a solution to my problem. </p>
  
  <p>This is what I'm trying to do: </p>
  
  <p>Atm this happens: </p>
  
  <pre><code>--------------------
  | The displayed str|ing 
  --------------------
  </code></pre>
  
  <p>And I want this: </p>
  
  <pre><code>--------------------
  | The displayed st | 
  --------------------
  </code></pre>
  
  <p>This is my code so far: </p>
  
  <pre><code>while ($row = mysqli_fetch_array($result)) {
      $textline = explode(".", $row["text"]);
  }
  
  $i = 0;
  
  foreach ($textline as $o) {
     $letters = str_split_unicode($letters[$i], 1);
     if (ctype_space($letters[0])) {
           unset($letters[0]);
     }
     foreach ($letters as $l) {
        if (ctype_space($l)) {
           echo "&lt;p&gt;&amp;nbsp;&lt;/p&gt;";
        } else {
          echo "&lt;p&gt;$l&lt;/p&gt;";
        }
     }
              $i++;
  }
  </code></pre>
  
  <p>To sum up: I want to split the string after 'x' characters, NOT on '.' as it is now</p>
  
  <p>//edit: </p>
  
  <p>The code splits the text splits at punctuation, but I want it to split after "x" characters</p>
  
  <p>Now it splits like this: </p>
  
  <blockquote>
  <pre><code>This is a sentence. 
  This is another sentence. 
  This is a third sentence.
  </code></pre>
  </blockquote>
  
  <p>But I want it to split like this: </p>
  
  <blockquote>
  <pre><code>This is a sent
  ence. This is 
  another senten
  ce. This is a 
  third sentence
  .
  </code></pre>
  </blockquote>
  
  <p>Here it splits after 14 characters (including space).</p>