title: Wrap text every 2500 characters in a <div> for pagination using PHP or javascript
body: <p>I have a long block of text. I'd like to wrap every 2500 characters of this text into a <code>&lt;div&gt;</code> such I could do pagination on it.</p>
  
  <p>The following doesn't work:</p>
  
  <pre><code>//replace 2500 for 5 for purpose of this example
  $text="sfdkjas;fakska;ldjk";
  $text=wordwrap($text, 5, '&lt;div class="individualPage"&gt;');
  </code></pre>
  
  <p>output: </p>
  
  <pre><code>sfdkj&lt;div class="individualPage"&gt;as;fa&lt;div class="individualPage"&gt;kska;l&lt;div
  class="individualPage"&gt;djk
  </code></pre>
  
  <p>Obviously I need the closing <code>&lt;/div&gt;</code> tag to make this work. </p>
  
  <p>Does anyone have a suggestion for this in PHP or Javascript/jQuery?</p>