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